mirror of https://github.com/BTCPrivate/lnd.git
Merge pull request #743 from cfromknecht/brar-infinite-loop-fix
breacharbiter: avoid infinite loop in exactRetribution
This commit is contained in:
commit
8cb2097db2
|
@ -519,8 +519,17 @@ secondLevelCheck:
|
||||||
brarLog.Errorf("unable to check for spentness "+
|
brarLog.Errorf("unable to check for spentness "+
|
||||||
"of out_point=%v: %v",
|
"of out_point=%v: %v",
|
||||||
breachedOutput.outpoint, err)
|
breachedOutput.outpoint, err)
|
||||||
|
|
||||||
|
// Registration may have failed if we've been
|
||||||
|
// instructed to shutdown. If so, return here to
|
||||||
|
// avoid entering an infinite loop.
|
||||||
|
select {
|
||||||
|
case <-b.quit:
|
||||||
|
return
|
||||||
|
default:
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
// The output has been taken to the second level!
|
// The output has been taken to the second level!
|
||||||
|
@ -575,9 +584,17 @@ secondLevelCheck:
|
||||||
brarLog.Infof("Attempting to transfer HTLC revocations " +
|
brarLog.Infof("Attempting to transfer HTLC revocations " +
|
||||||
"to the second level")
|
"to the second level")
|
||||||
finalTx = nil
|
finalTx = nil
|
||||||
|
|
||||||
|
// Txn publication may fail if we're shutting down.
|
||||||
|
// If so, return to avoid entering an infinite loop.
|
||||||
|
select {
|
||||||
|
case <-b.quit:
|
||||||
|
return
|
||||||
|
default:
|
||||||
goto secondLevelCheck
|
goto secondLevelCheck
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// As a conclusionary step, we register for a notification to be
|
// As a conclusionary step, we register for a notification to be
|
||||||
// dispatched once the justice tx is confirmed. After confirmation we
|
// dispatched once the justice tx is confirmed. After confirmation we
|
||||||
|
|
Loading…
Reference in New Issue