breacharbiter_test: select on quit chan on publication
Since publication would deadlock on publishing the tx in case the test had failed we also select on the brar quit channel.
This commit is contained in:
parent
dee6a1a29b
commit
07c0277f3b
@ -1604,7 +1604,12 @@ func testBreachSpends(t *testing.T, test breachTest) {
|
||||
publMtx.Lock()
|
||||
err := publErr
|
||||
publMtx.Unlock()
|
||||
publTx <- tx
|
||||
|
||||
select {
|
||||
case publTx <- tx:
|
||||
case <-brar.quit:
|
||||
return fmt.Errorf("brar quit")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
@ -1817,7 +1822,11 @@ func TestBreachDelayedJusticeConfirmation(t *testing.T) {
|
||||
|
||||
// Make PublishTransaction always return succeed.
|
||||
brar.cfg.PublishTransaction = func(tx *wire.MsgTx, _ string) error {
|
||||
publTx <- tx
|
||||
select {
|
||||
case publTx <- tx:
|
||||
case <-brar.quit:
|
||||
return fmt.Errorf("brar quit")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user