contractcourt+lnd: add debug log
This commit is contained in:
2 files changed
+18
-5
No files matched your search
@@ -176,6 +176,7 @@ func (b *breachArbiter) start() error {
|
|||||||
}, func() {
|
}, func() {
|
||||||
breachRetInfos = make(map[wire.OutPoint]retributionInfo)
|
breachRetInfos = make(map[wire.OutPoint]retributionInfo)
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
brarLog.Errorf("Unable to create retribution info: %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,6 +191,9 @@ func (b *breachArbiter) start() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
brarLog.Debugf("Found %v closing channels, %v retribution records",
|
||||||
|
len(closedChans), len(breachRetInfos))
|
||||||
|
|
||||||
// Using the set of non-pending, closed channels, reconcile any
|
// Using the set of non-pending, closed channels, reconcile any
|
||||||
// discrepancies between the channeldb and the retribution store by
|
// discrepancies between the channeldb and the retribution store by
|
||||||
// removing any retribution information for which we have already
|
// removing any retribution information for which we have already
|
||||||
@@ -199,6 +203,9 @@ func (b *breachArbiter) start() error {
|
|||||||
// TODO(halseth): no need continue on IsPending once closed channels
|
// TODO(halseth): no need continue on IsPending once closed channels
|
||||||
// actually means close transaction is confirmed.
|
// actually means close transaction is confirmed.
|
||||||
for _, chanSummary := range closedChans {
|
for _, chanSummary := range closedChans {
|
||||||
|
brarLog.Debugf("Working on close channel: %v, is_pending: %v",
|
||||||
|
chanSummary.ChanPoint, chanSummary.IsPending)
|
||||||
|
|
||||||
if chanSummary.IsPending {
|
if chanSummary.IsPending {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -212,6 +219,9 @@ func (b *breachArbiter) start() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
delete(breachRetInfos, *chanPoint)
|
delete(breachRetInfos, *chanPoint)
|
||||||
|
|
||||||
|
brarLog.Debugf("Skipped closed channel: %v",
|
||||||
|
chanSummary.ChanPoint)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,6 +230,9 @@ func (b *breachArbiter) start() error {
|
|||||||
for chanPoint := range breachRetInfos {
|
for chanPoint := range breachRetInfos {
|
||||||
retInfo := breachRetInfos[chanPoint]
|
retInfo := breachRetInfos[chanPoint]
|
||||||
|
|
||||||
|
brarLog.Debugf("Handling breach handoff on startup "+
|
||||||
|
"for ChannelPoint(%v)", chanPoint)
|
||||||
|
|
||||||
// Register for a notification when the breach transaction is
|
// Register for a notification when the breach transaction is
|
||||||
// confirmed on chain.
|
// confirmed on chain.
|
||||||
breachTXID := retInfo.commitHash
|
breachTXID := retInfo.commitHash
|
||||||
|
|||||||
@@ -435,10 +435,10 @@ func (c *ChannelArbitrator) Start(state *chanArbStartState) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debugf("Starting ChannelArbitrator(%v), htlc_set=%v",
|
log.Debugf("Starting ChannelArbitrator(%v), htlc_set=%v, state=%v",
|
||||||
c.cfg.ChanPoint, newLogClosure(func() string {
|
c.cfg.ChanPoint, newLogClosure(func() string {
|
||||||
return spew.Sdump(c.activeHTLCs)
|
return spew.Sdump(c.activeHTLCs)
|
||||||
}),
|
}), state.currentState,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Set our state from our starting state.
|
// Set our state from our starting state.
|
||||||
@@ -795,7 +795,7 @@ func (c *ChannelArbitrator) stateStep(
|
|||||||
// default state. If this isn't a self initiated event (we're
|
// default state. If this isn't a self initiated event (we're
|
||||||
// checking due to a chain update), then we'll exit now.
|
// checking due to a chain update), then we'll exit now.
|
||||||
if len(chainActions) == 0 && trigger == chainTrigger {
|
if len(chainActions) == 0 && trigger == chainTrigger {
|
||||||
log.Tracef("ChannelArbitrator(%v): no actions for "+
|
log.Debugf("ChannelArbitrator(%v): no actions for "+
|
||||||
"chain trigger, terminating", c.cfg.ChanPoint)
|
"chain trigger, terminating", c.cfg.ChanPoint)
|
||||||
|
|
||||||
return StateDefault, closeTx, nil
|
return StateDefault, closeTx, nil
|
||||||
@@ -1303,7 +1303,7 @@ func (c *ChannelArbitrator) advanceState(
|
|||||||
// transition to is that same state that we started at.
|
// transition to is that same state that we started at.
|
||||||
for {
|
for {
|
||||||
priorState = c.state
|
priorState = c.state
|
||||||
log.Tracef("ChannelArbitrator(%v): attempting state step with "+
|
log.Debugf("ChannelArbitrator(%v): attempting state step with "+
|
||||||
"trigger=%v from state=%v", c.cfg.ChanPoint, trigger,
|
"trigger=%v from state=%v", c.cfg.ChanPoint, trigger,
|
||||||
priorState)
|
priorState)
|
||||||
|
|
||||||
@@ -1324,7 +1324,7 @@ func (c *ChannelArbitrator) advanceState(
|
|||||||
// our prior state back as the next state, then we'll
|
// our prior state back as the next state, then we'll
|
||||||
// terminate.
|
// terminate.
|
||||||
if nextState == priorState {
|
if nextState == priorState {
|
||||||
log.Tracef("ChannelArbitrator(%v): terminating at "+
|
log.Debugf("ChannelArbitrator(%v): terminating at "+
|
||||||
"state=%v", c.cfg.ChanPoint, nextState)
|
"state=%v", c.cfg.ChanPoint, nextState)
|
||||||
return nextState, forceCloseTx, nil
|
return nextState, forceCloseTx, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user