Merge pull request #4345 from matheusdtech/brar-flake

breacharbiter: fix flaky race condition in test
This commit is contained in:
Olaoluwa Osuntokun 2020-06-15 10:41:44 -07:00 committed by GitHub
commit 1cce50d3b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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.