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.
|
// Make PublishTransaction always return ErrDoubleSpend to begin with.
|
||||||
publErr = lnwallet.ErrDoubleSpend
|
publErr = lnwallet.ErrDoubleSpend
|
||||||
brar.cfg.PublishTransaction = func(tx *wire.MsgTx, _ string) error {
|
brar.cfg.PublishTransaction = func(tx *wire.MsgTx, _ string) error {
|
||||||
|
publMtx.Lock()
|
||||||
|
err := publErr
|
||||||
|
publMtx.Unlock()
|
||||||
publTx <- tx
|
publTx <- tx
|
||||||
|
|
||||||
publMtx.Lock()
|
return err
|
||||||
defer publMtx.Unlock()
|
|
||||||
return publErr
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify the breach arbiter about the breach.
|
// Notify the breach arbiter about the breach.
|
||||||
|
Loading…
Reference in New Issue
Block a user