mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-11 09:21:38 +02:00
multi: improve logging re resolution flow
This commit is contained in:
parent
8f693fe020
commit
aff4320208
@ -1103,15 +1103,15 @@ func (c *ChannelArbitrator) stateStep(
|
|||||||
return StateError, closeTx, err
|
return StateError, closeTx, err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debugf("ChannelArbitrator(%v): sending resolution message=%v",
|
|
||||||
c.cfg.ChanPoint,
|
|
||||||
newLogClosure(func() string {
|
|
||||||
return spew.Sdump(pktsToSend)
|
|
||||||
}))
|
|
||||||
|
|
||||||
// With the commitment broadcast, we'll then send over all
|
// With the commitment broadcast, we'll then send over all
|
||||||
// messages we can send immediately.
|
// messages we can send immediately.
|
||||||
if len(pktsToSend) != 0 {
|
if len(pktsToSend) != 0 {
|
||||||
|
log.Debugf("ChannelArbitrator(%v): sending "+
|
||||||
|
"resolution message=%v", c.cfg.ChanPoint,
|
||||||
|
newLogClosure(func() string {
|
||||||
|
return spew.Sdump(pktsToSend)
|
||||||
|
}))
|
||||||
|
|
||||||
err := c.cfg.DeliverResolutionMsg(pktsToSend...)
|
err := c.cfg.DeliverResolutionMsg(pktsToSend...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("unable to send pkts: %v", err)
|
log.Errorf("unable to send pkts: %v", err)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package input
|
package input
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcutil"
|
"github.com/btcsuite/btcd/btcutil"
|
||||||
"github.com/btcsuite/btcd/txscript"
|
"github.com/btcsuite/btcd/txscript"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/btcsuite/btcd/wire"
|
||||||
@ -69,6 +71,11 @@ type TxInfo struct {
|
|||||||
Weight int64
|
Weight int64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// String returns a human readable version of the tx info.
|
||||||
|
func (t *TxInfo) String() string {
|
||||||
|
return fmt.Sprintf("fee=%v, weight=%v", t.Fee, t.Weight)
|
||||||
|
}
|
||||||
|
|
||||||
// SignDetails is a struct containing information needed to resign certain
|
// SignDetails is a struct containing information needed to resign certain
|
||||||
// inputs. It is used to re-sign 2nd level HTLC transactions that uses the
|
// inputs. It is used to re-sign 2nd level HTLC transactions that uses the
|
||||||
// SINGLE|ANYONECANPAY sighash type, as we have a signature provided by our
|
// SINGLE|ANYONECANPAY sighash type, as we have a signature provided by our
|
||||||
|
@ -98,8 +98,13 @@ type ParamsUpdate struct {
|
|||||||
|
|
||||||
// String returns a human readable interpretation of the sweep parameters.
|
// String returns a human readable interpretation of the sweep parameters.
|
||||||
func (p Params) String() string {
|
func (p Params) String() string {
|
||||||
return fmt.Sprintf("fee=%v, force=%v, exclusive_group=%v",
|
if p.ExclusiveGroup != nil {
|
||||||
p.Fee, p.Force, p.ExclusiveGroup)
|
return fmt.Sprintf("fee=%v, force=%v, exclusive_group=%v",
|
||||||
|
p.Fee, p.Force, *p.ExclusiveGroup)
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Sprintf("fee=%v, force=%v, exclusive_group=nil",
|
||||||
|
p.Fee, p.Force)
|
||||||
}
|
}
|
||||||
|
|
||||||
// pendingInput is created when an input reaches the main loop for the first
|
// pendingInput is created when an input reaches the main loop for the first
|
||||||
@ -463,9 +468,10 @@ func (s *UtxoSweeper) SweepInput(input input.Input,
|
|||||||
absoluteTimeLock, _ := input.RequiredLockTime()
|
absoluteTimeLock, _ := input.RequiredLockTime()
|
||||||
log.Infof("Sweep request received: out_point=%v, witness_type=%v, "+
|
log.Infof("Sweep request received: out_point=%v, witness_type=%v, "+
|
||||||
"relative_time_lock=%v, absolute_time_lock=%v, amount=%v, "+
|
"relative_time_lock=%v, absolute_time_lock=%v, amount=%v, "+
|
||||||
"params=(%v)", input.OutPoint(), input.WitnessType(),
|
"parent=(%v), params=(%v)", input.OutPoint(),
|
||||||
input.BlocksToMaturity(), absoluteTimeLock,
|
input.WitnessType(), input.BlocksToMaturity(), absoluteTimeLock,
|
||||||
btcutil.Amount(input.SignDesc().Output.Value), params)
|
btcutil.Amount(input.SignDesc().Output.Value),
|
||||||
|
input.UnconfParent(), params)
|
||||||
|
|
||||||
sweeperInput := &sweepInputMessage{
|
sweeperInput := &sweepInputMessage{
|
||||||
input: input,
|
input: input,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user