Merge pull request #743 from cfromknecht/brar-infinite-loop-fix

breacharbiter: avoid infinite loop in exactRetribution
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2018-02-08 15:22:48 -08:00
commit 8cb2097db2
1 file changed
+19 -2
+19 -2
View File
@@ -519,7 +519,16 @@ secondLevelCheck:
brarLog.Errorf("unable to check for spentness "+
"of out_point=%v: %v",
breachedOutput.outpoint, err)
continue
// 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
}
}
select {
@@ -575,7 +584,15 @@ secondLevelCheck:
brarLog.Infof("Attempting to transfer HTLC revocations " +
"to the second level")
finalTx = nil
goto secondLevelCheck
// 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
}
}
}