multi: improve loggings
This commit is contained in:
1 parent
45b243c91c
commit
1d53e7d081
6 files changed
+23
-17
No files matched your search
@@ -1610,8 +1610,8 @@ func (c *ChannelArbitrator) advanceState(
|
|||||||
for {
|
for {
|
||||||
priorState = c.state
|
priorState = c.state
|
||||||
log.Debugf("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 at height=%v",
|
||||||
priorState)
|
c.cfg.ChanPoint, trigger, priorState, triggerHeight)
|
||||||
|
|
||||||
nextState, closeTx, err := c.stateStep(
|
nextState, closeTx, err := c.stateStep(
|
||||||
triggerHeight, trigger, confCommitSet,
|
triggerHeight, trigger, confCommitSet,
|
||||||
@@ -2822,14 +2822,12 @@ func (c *ChannelArbitrator) channelAttendant(bestHeight int32,
|
|||||||
// We have broadcasted our commitment, and it is now confirmed
|
// We have broadcasted our commitment, and it is now confirmed
|
||||||
// on-chain.
|
// on-chain.
|
||||||
case closeInfo := <-c.cfg.ChainEvents.LocalUnilateralClosure:
|
case closeInfo := <-c.cfg.ChainEvents.LocalUnilateralClosure:
|
||||||
log.Infof("ChannelArbitrator(%v): local on-chain "+
|
|
||||||
"channel close", c.cfg.ChanPoint)
|
|
||||||
|
|
||||||
if c.state != StateCommitmentBroadcasted {
|
if c.state != StateCommitmentBroadcasted {
|
||||||
log.Errorf("ChannelArbitrator(%v): unexpected "+
|
log.Errorf("ChannelArbitrator(%v): unexpected "+
|
||||||
"local on-chain channel close",
|
"local on-chain channel close",
|
||||||
c.cfg.ChanPoint)
|
c.cfg.ChanPoint)
|
||||||
}
|
}
|
||||||
|
|
||||||
closeTx := closeInfo.CloseTx
|
closeTx := closeInfo.CloseTx
|
||||||
|
|
||||||
resolutions, err := closeInfo.ContractResolutions.
|
resolutions, err := closeInfo.ContractResolutions.
|
||||||
@@ -2857,6 +2855,10 @@ func (c *ChannelArbitrator) channelAttendant(bestHeight int32,
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Infof("ChannelArbitrator(%v): local force close "+
|
||||||
|
"tx=%v confirmed", c.cfg.ChanPoint,
|
||||||
|
closeTx.TxHash())
|
||||||
|
|
||||||
contractRes := &ContractResolutions{
|
contractRes := &ContractResolutions{
|
||||||
CommitHash: closeTx.TxHash(),
|
CommitHash: closeTx.TxHash(),
|
||||||
CommitResolution: resolutions.CommitResolution,
|
CommitResolution: resolutions.CommitResolution,
|
||||||
|
|||||||
@@ -57,10 +57,10 @@ func (h *htlcLeaseResolver) makeSweepInput(op *wire.OutPoint,
|
|||||||
signDesc *input.SignDescriptor, csvDelay, broadcastHeight uint32,
|
signDesc *input.SignDescriptor, csvDelay, broadcastHeight uint32,
|
||||||
payHash [32]byte, resBlob fn.Option[tlv.Blob]) *input.BaseInput {
|
payHash [32]byte, resBlob fn.Option[tlv.Blob]) *input.BaseInput {
|
||||||
|
|
||||||
if h.hasCLTV() {
|
log.Infof("%T(%x): offering second-layer output to sweeper: %v", h,
|
||||||
log.Infof("%T(%x): CSV and CLTV locks expired, offering "+
|
payHash, op)
|
||||||
"second-layer output to sweeper: %v", h, payHash, op)
|
|
||||||
|
|
||||||
|
if h.hasCLTV() {
|
||||||
return input.NewCsvInputWithCltv(
|
return input.NewCsvInputWithCltv(
|
||||||
op, cltvWtype, signDesc,
|
op, cltvWtype, signDesc,
|
||||||
broadcastHeight, csvDelay,
|
broadcastHeight, csvDelay,
|
||||||
|
|||||||
@@ -794,7 +794,7 @@ func (u *UtxoNursery) graduateClass(classHeight uint32) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
utxnLog.Infof("Attempting to graduate height=%v: num_kids=%v, "+
|
utxnLog.Debugf("Attempting to graduate height=%v: num_kids=%v, "+
|
||||||
"num_babies=%v", classHeight, len(kgtnOutputs), len(cribOutputs))
|
"num_babies=%v", classHeight, len(kgtnOutputs), len(cribOutputs))
|
||||||
|
|
||||||
// Offer the outputs to the sweeper and set up notifications that will
|
// Offer the outputs to the sweeper and set up notifications that will
|
||||||
|
|||||||
@@ -1606,7 +1606,7 @@ out:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Infof("Received outside contract resolution, "+
|
log.Debugf("Received outside contract resolution, "+
|
||||||
"mapping to: %v", spew.Sdump(pkt))
|
"mapping to: %v", spew.Sdump(pkt))
|
||||||
|
|
||||||
// We don't check the error, as the only failure we can
|
// We don't check the error, as the only failure we can
|
||||||
|
|||||||
+1
-1
@@ -733,7 +733,7 @@ func (l *LightningWallet) RegisterFundingIntent(expectedID [32]byte,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := l.fundingIntents[expectedID]; ok {
|
if _, ok := l.fundingIntents[expectedID]; ok {
|
||||||
return fmt.Errorf("%w: already has intent registered: %v",
|
return fmt.Errorf("%w: already has intent registered: %x",
|
||||||
ErrDuplicatePendingChanID, expectedID[:])
|
ErrDuplicatePendingChanID, expectedID[:])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-6
@@ -242,8 +242,9 @@ func (p *SweeperInput) isMature(currentHeight uint32) (bool, uint32) {
|
|||||||
// currentHeight plus one.
|
// currentHeight plus one.
|
||||||
locktime = p.BlocksToMaturity() + p.HeightHint()
|
locktime = p.BlocksToMaturity() + p.HeightHint()
|
||||||
if currentHeight+1 < locktime {
|
if currentHeight+1 < locktime {
|
||||||
log.Debugf("Input %v has CSV expiry=%v, current height is %v",
|
log.Debugf("Input %v has CSV expiry=%v, current height is %v, "+
|
||||||
p.OutPoint(), locktime, currentHeight)
|
"skipped sweeping", p.OutPoint(), locktime,
|
||||||
|
currentHeight)
|
||||||
|
|
||||||
return false, locktime
|
return false, locktime
|
||||||
}
|
}
|
||||||
@@ -1197,8 +1198,8 @@ func (s *UtxoSweeper) calculateDefaultDeadline(pi *SweeperInput) int32 {
|
|||||||
if !matured {
|
if !matured {
|
||||||
defaultDeadline = int32(locktime + s.cfg.NoDeadlineConfTarget)
|
defaultDeadline = int32(locktime + s.cfg.NoDeadlineConfTarget)
|
||||||
log.Debugf("Input %v is immature, using locktime=%v instead "+
|
log.Debugf("Input %v is immature, using locktime=%v instead "+
|
||||||
"of current height=%d", pi.OutPoint(), locktime,
|
"of current height=%d as starting height",
|
||||||
s.currentHeight)
|
pi.OutPoint(), locktime, s.currentHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
return defaultDeadline
|
return defaultDeadline
|
||||||
@@ -1210,7 +1211,8 @@ func (s *UtxoSweeper) handleNewInput(input *sweepInputMessage) error {
|
|||||||
outpoint := input.input.OutPoint()
|
outpoint := input.input.OutPoint()
|
||||||
pi, pending := s.inputs[outpoint]
|
pi, pending := s.inputs[outpoint]
|
||||||
if pending {
|
if pending {
|
||||||
log.Debugf("Already has pending input %v received", outpoint)
|
log.Infof("Already has pending input %v received, old params: "+
|
||||||
|
"%v, new params %v", outpoint, pi.params, input.params)
|
||||||
|
|
||||||
s.handleExistingInput(input, pi)
|
s.handleExistingInput(input, pi)
|
||||||
|
|
||||||
@@ -1492,6 +1494,8 @@ func (s *UtxoSweeper) updateSweeperInputs() InputsMap {
|
|||||||
// turn this inputs map into a SyncMap in case we wanna add concurrent
|
// turn this inputs map into a SyncMap in case we wanna add concurrent
|
||||||
// access to the map in the future.
|
// access to the map in the future.
|
||||||
for op, input := range s.inputs {
|
for op, input := range s.inputs {
|
||||||
|
log.Tracef("Checking input: %s, state=%v", input, input.state)
|
||||||
|
|
||||||
// If the input has reached a final state, that it's either
|
// If the input has reached a final state, that it's either
|
||||||
// been swept, or failed, or excluded, we will remove it from
|
// been swept, or failed, or excluded, we will remove it from
|
||||||
// our sweeper.
|
// our sweeper.
|
||||||
@@ -1521,7 +1525,7 @@ func (s *UtxoSweeper) updateSweeperInputs() InputsMap {
|
|||||||
// skip this input and wait for the locktime to be reached.
|
// skip this input and wait for the locktime to be reached.
|
||||||
mature, locktime := input.isMature(uint32(s.currentHeight))
|
mature, locktime := input.isMature(uint32(s.currentHeight))
|
||||||
if !mature {
|
if !mature {
|
||||||
log.Infof("Skipping input %v due to locktime=%v not "+
|
log.Debugf("Skipping input %v due to locktime=%v not "+
|
||||||
"reached, current height is %v", op, locktime,
|
"reached, current height is %v", op, locktime,
|
||||||
s.currentHeight)
|
s.currentHeight)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user