multi: add SpewLogClosure to avoid code repetition

This commit is contained in:
yyforyongyu
2024-07-25 22:18:00 +08:00
parent b6049ff94b
commit d992cf94d6
19 changed files with 57 additions and 144 deletions

View File

@@ -12,7 +12,6 @@ import (
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcwallet/chain"
"github.com/davecgh/go-spew/spew"
"github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/fn"
"github.com/lightningnetwork/lnd/input"
@@ -313,10 +312,8 @@ func (t *TxPublisher) isNeutrinoBackend() bool {
//
// NOTE: part of the Bumper interface.
func (t *TxPublisher) Broadcast(req *BumpRequest) (<-chan *BumpResult, error) {
log.Tracef("Received broadcast request: %s", lnutils.NewLogClosure(
func() string {
return spew.Sdump(req)
})())
log.Tracef("Received broadcast request: %s", lnutils.SpewLogClosure(
req))
// Attempt an initial broadcast which is guaranteed to comply with the
// RBF rules.

View File

@@ -1377,10 +1377,7 @@ func (s *UtxoSweeper) handleInputSpent(spend *chainntnfs.SpendDetail) {
log.Debugf("Detected third party spend related to in flight "+
"inputs (is_ours=%v): %v", isOurTx,
lnutils.NewLogClosure(func() string {
return spew.Sdump(spend.SpendingTx)
}),
)
lnutils.SpewLogClosure(spend.SpendingTx))
}
// We now use the spending tx to update the state of the inputs.