mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-26 13:42:49 +02:00
watchtower: fix logging and add comments
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/davecgh/go-spew/spew"
|
||||||
"github.com/lightningnetwork/lnd/input"
|
"github.com/lightningnetwork/lnd/input"
|
||||||
"github.com/lightningnetwork/lnd/lntypes"
|
"github.com/lightningnetwork/lnd/lntypes"
|
||||||
|
"github.com/lightningnetwork/lnd/lnutils"
|
||||||
"github.com/lightningnetwork/lnd/watchtower/blob"
|
"github.com/lightningnetwork/lnd/watchtower/blob"
|
||||||
"github.com/lightningnetwork/lnd/watchtower/wtdb"
|
"github.com/lightningnetwork/lnd/watchtower/wtdb"
|
||||||
)
|
)
|
||||||
@@ -230,6 +231,9 @@ func (p *JusticeDescriptor) CreateJusticeTxn() (*wire.MsgTx, error) {
|
|||||||
case input.P2WPKHSize:
|
case input.P2WPKHSize:
|
||||||
weightEstimate.AddP2WKHOutput()
|
weightEstimate.AddP2WKHOutput()
|
||||||
|
|
||||||
|
// NOTE: P2TR has the same size as P2WSH (34 bytes), their output sizes
|
||||||
|
// are also the same (43 bytes), so here we implicitly catch the P2TR
|
||||||
|
// output case.
|
||||||
case input.P2WSHSize:
|
case input.P2WSHSize:
|
||||||
weightEstimate.AddP2WSHOutput()
|
weightEstimate.AddP2WSHOutput()
|
||||||
|
|
||||||
@@ -260,8 +264,9 @@ func (p *JusticeDescriptor) CreateJusticeTxn() (*wire.MsgTx, error) {
|
|||||||
|
|
||||||
sweepInputs = append(sweepInputs, toLocalInput)
|
sweepInputs = append(sweepInputs, toLocalInput)
|
||||||
|
|
||||||
log.Debugf("Found to local witness output=%#v, stack=%v",
|
log.Debugf("Found to local witness output=%v, stack=%x",
|
||||||
toLocalInput.txOut, toLocalInput.witness)
|
lnutils.SpewLogClosure(toLocalInput.txOut),
|
||||||
|
toLocalInput.witness)
|
||||||
|
|
||||||
// If the justice kit specifies that we have to sweep the to-remote
|
// If the justice kit specifies that we have to sweep the to-remote
|
||||||
// output, we'll also try to assemble the output and add it to weight
|
// output, we'll also try to assemble the output and add it to weight
|
||||||
@@ -273,8 +278,9 @@ func (p *JusticeDescriptor) CreateJusticeTxn() (*wire.MsgTx, error) {
|
|||||||
}
|
}
|
||||||
sweepInputs = append(sweepInputs, toRemoteInput)
|
sweepInputs = append(sweepInputs, toRemoteInput)
|
||||||
|
|
||||||
log.Debugf("Found to remote witness output=%#v, stack=%v",
|
log.Debugf("Found to remote witness output=%v, stack=%x",
|
||||||
toRemoteInput.txOut, toRemoteInput.witness)
|
lnutils.SpewLogClosure(toRemoteInput.txOut),
|
||||||
|
toRemoteInput.witness)
|
||||||
|
|
||||||
// Get the weight for the to-remote witness and add that to the
|
// Get the weight for the to-remote witness and add that to the
|
||||||
// estimator.
|
// estimator.
|
||||||
|
Reference in New Issue
Block a user