channeldb+contractcourt: add additional logging around co-op channel closes

This commit is contained in:
Olaoluwa Osuntokun 2018-04-12 17:13:28 -07:00
parent f667e3b29f
commit 7a13378671
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21
3 changed files with 17 additions and 12 deletions

@ -493,8 +493,8 @@ func (d *DB) MarkChanFullyClosed(chanPoint *wire.OutPoint) error {
chanSummaryBytes := closedChanBucket.Get(chanID)
if chanSummaryBytes == nil {
return fmt.Errorf("no closed channel by that chanID " +
"found")
return fmt.Errorf("no closed channel for "+
"chan_point=%v found", chanPoint)
}
chanSummaryReader := bytes.NewReader(chanSummaryBytes)

@ -276,6 +276,8 @@ func (c *ChainArbitrator) resolveContract(chanPoint wire.OutPoint,
// the channel source.
err := c.chanSource.MarkChanFullyClosed(&chanPoint)
if err != nil {
log.Errorf("ChainArbitrator: unable to mark ChannelPoint(%v) "+
"fully closed: %v", chanPoint, err)
return err
}

@ -457,8 +457,9 @@ func (c *chainWatcher) dispatchCooperativeClose(commitSpend *chainntnfs.SpendDet
return
}
log.Infof("Waiting for txid=%v to close ChannelPoint(%v) on chain",
commitSpend.SpenderTxHash, c.chanState.FundingOutpoint)
log.Infof("closeObserver: waiting for txid=%v to close "+
"ChannelPoint(%v) on chain", commitSpend.SpenderTxHash,
c.chanState.FundingOutpoint)
select {
case confInfo, ok := <-confNtfn.Confirmed:
@ -467,8 +468,9 @@ func (c *chainWatcher) dispatchCooperativeClose(commitSpend *chainntnfs.SpendDet
return
}
log.Infof("ChannelPoint(%v) is fully closed, at height: %v",
c.chanState.FundingOutpoint, confInfo.BlockHeight)
log.Infof("closeObserver: ChannelPoint(%v) is fully "+
"closed, at height: %v", c.chanState.FundingOutpoint,
confInfo.BlockHeight)
err := c.markChanClosed()
if err != nil {
@ -724,8 +726,9 @@ func (c *CooperativeCloseCtx) LogPotentialClose(potentialClose *channeldb.Channe
return
}
log.Infof("Waiting for txid=%v to close ChannelPoint(%v) on chain",
potentialClose.ClosingTXID, c.watcher.chanState.FundingOutpoint)
log.Infof("closeCtx: waiting for txid=%v to close "+
"ChannelPoint(%v) on chain", potentialClose.ClosingTXID,
c.watcher.chanState.FundingOutpoint)
select {
case confInfo, ok := <-confNtfn.Confirmed:
@ -734,7 +737,7 @@ func (c *CooperativeCloseCtx) LogPotentialClose(potentialClose *channeldb.Channe
return
}
log.Infof("ChannelPoint(%v) is fully closed, at "+
log.Infof("closeCtx: ChannelPoint(%v) is fully closed, at "+
"height: %v", c.watcher.chanState.FundingOutpoint,
confInfo.BlockHeight)
@ -751,14 +754,14 @@ func (c *CooperativeCloseCtx) LogPotentialClose(potentialClose *channeldb.Channe
err := c.watcher.chanState.CloseChannel(potentialClose)
if err != nil {
log.Warnf("unable to update latest close for "+
"ChannelPoint(%v): %v",
log.Warnf("closeCtx: unable to update latest "+
"close for ChannelPoint(%v): %v",
c.watcher.chanState.FundingOutpoint, err)
}
err = c.watcher.markChanClosed()
if err != nil {
log.Errorf("unable to mark chan fully "+
log.Errorf("closeCtx: unable to mark chan fully "+
"closed: %v", err)
return
}