diff --git a/breacharbiter_test.go b/breacharbiter_test.go index e6eee250..01d9daf7 100644 --- a/breacharbiter_test.go +++ b/breacharbiter_test.go @@ -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.