mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 18:10:34 +01:00
Merge pull request #4345 from matheusdtech/brar-flake
breacharbiter: fix flaky race condition in test
This commit is contained in:
commit
1cce50d3b7
@ -1372,11 +1372,12 @@ func testBreachSpends(t *testing.T, test breachTest) {
|
||||
// Make PublishTransaction always return ErrDoubleSpend to begin with.
|
||||
publErr = lnwallet.ErrDoubleSpend
|
||||
brar.cfg.PublishTransaction = func(tx *wire.MsgTx, _ string) error {
|
||||
publMtx.Lock()
|
||||
err := publErr
|
||||
publMtx.Unlock()
|
||||
publTx <- tx
|
||||
|
||||
publMtx.Lock()
|
||||
defer publMtx.Unlock()
|
||||
return publErr
|
||||
return err
|
||||
}
|
||||
|
||||
// Notify the breach arbiter about the breach.
|
||||
|
Loading…
Reference in New Issue
Block a user