htlcswitch: face race condition in unit tests by returning invoice
In this commit we modify the primary InvoiceRegistry interface within the package to instead return a direct value for LookupInvoice rather than a pointer. This fixes an existing race condition wherein a caller could modify or read the value of the returned invoice.
This commit is contained in:
7 files changed
+23
-14
No files matched your search
@@ -3359,7 +3359,10 @@ func TestChanSyncUnableToSync(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestChanAvailableBandwidth...
|
||||
// TestChanAvailableBandwidth tests the accuracy of the AvailableBalance()
|
||||
// method. The value returned from this message should reflect the value
|
||||
// returned within the commitment state of a channel after the transition is
|
||||
// initiated.
|
||||
func TestChanAvailableBandwidth(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in new issue
Block a user