mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-13 11:09:23 +01:00
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
1 changed files with 11 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue