Merge pull request #1089 from halseth/resolvecontract-missing-return-on-exit
Add missing return on exit to resolveContract
This commit is contained in:
commit
5f0d07e485
@ -1162,11 +1162,14 @@ func (c *ChannelArbitrator) resolveContract(currentContract ContractResolver) {
|
|||||||
// Until the contract is fully resolved, we'll continue to iteratively
|
// Until the contract is fully resolved, we'll continue to iteratively
|
||||||
// resolve the contract one step at a time.
|
// resolve the contract one step at a time.
|
||||||
for !currentContract.IsResolved() {
|
for !currentContract.IsResolved() {
|
||||||
|
log.Debugf("ChannelArbitrator(%v): contract %T not yet resolved",
|
||||||
|
c.cfg.ChanPoint, currentContract)
|
||||||
|
|
||||||
select {
|
select {
|
||||||
|
|
||||||
// If we've been signalled to quit, then we'll exit early.
|
// If we've been signalled to quit, then we'll exit early.
|
||||||
case <-c.quit:
|
case <-c.quit:
|
||||||
|
return
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Otherwise, we'll attempt to resolve the current
|
// Otherwise, we'll attempt to resolve the current
|
||||||
@ -1174,7 +1177,8 @@ func (c *ChannelArbitrator) resolveContract(currentContract ContractResolver) {
|
|||||||
nextContract, err := currentContract.Resolve()
|
nextContract, err := currentContract.Resolve()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("ChannelArbitrator(%v): unable to "+
|
log.Errorf("ChannelArbitrator(%v): unable to "+
|
||||||
"progress resolver: %v", c.cfg.ChanPoint, err)
|
"progress resolver: %v",
|
||||||
|
c.cfg.ChanPoint, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1185,7 +1189,7 @@ func (c *ChannelArbitrator) resolveContract(currentContract ContractResolver) {
|
|||||||
// within our logs: the new contract will take the
|
// within our logs: the new contract will take the
|
||||||
// place of the old one.
|
// place of the old one.
|
||||||
case nextContract != nil:
|
case nextContract != nil:
|
||||||
log.Tracef("ChannelArbitrator(%v): swapping "+
|
log.Debugf("ChannelArbitrator(%v): swapping "+
|
||||||
"out contract %T for %T ",
|
"out contract %T for %T ",
|
||||||
c.cfg.ChanPoint, currentContract,
|
c.cfg.ChanPoint, currentContract,
|
||||||
nextContract)
|
nextContract)
|
||||||
@ -1206,7 +1210,7 @@ func (c *ChannelArbitrator) resolveContract(currentContract ContractResolver) {
|
|||||||
// If this contract is actually fully resolved, then
|
// If this contract is actually fully resolved, then
|
||||||
// we'll mark it as such within the database.
|
// we'll mark it as such within the database.
|
||||||
case currentContract.IsResolved():
|
case currentContract.IsResolved():
|
||||||
log.Tracef("ChannelArbitrator(%v): marking "+
|
log.Debugf("ChannelArbitrator(%v): marking "+
|
||||||
"contract %T fully resolved",
|
"contract %T fully resolved",
|
||||||
c.cfg.ChanPoint, currentContract)
|
c.cfg.ChanPoint, currentContract)
|
||||||
|
|
||||||
|
@ -6278,9 +6278,9 @@ func testMultHopRemoteForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
|
|||||||
|
|
||||||
// Bob's sweeping transaction should now be found in the mempool at
|
// Bob's sweeping transaction should now be found in the mempool at
|
||||||
// this point.
|
// this point.
|
||||||
_, err = waitForTxInMempool(net.Miner.Node, time.Second*10)
|
_, err = waitForTxInMempool(net.Miner.Node, time.Second*20)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unable to find bob's sweeping transaction")
|
t.Fatalf("unable to find bob's sweeping transaction: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we mine an additional block, then this should confirm Bob's
|
// If we mine an additional block, then this should confirm Bob's
|
||||||
|
@ -429,7 +429,12 @@ func (hn *HarnessNode) stop() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Wait for lnd process and other goroutines to exit.
|
// Wait for lnd process and other goroutines to exit.
|
||||||
<-hn.processExit
|
select {
|
||||||
|
case <-hn.processExit:
|
||||||
|
case <-time.After(60 * time.Second):
|
||||||
|
return fmt.Errorf("process did not exit")
|
||||||
|
}
|
||||||
|
|
||||||
close(hn.quit)
|
close(hn.quit)
|
||||||
hn.wg.Wait()
|
hn.wg.Wait()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user