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

@@ -4,7 +4,6 @@ import (
"net"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/davecgh/go-spew/spew"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/keychain"
"github.com/lightningnetwork/lnd/lnutils"
@@ -64,9 +63,8 @@ func Recover(backups []Single, restorer ChannelRestorer,
log.Infof("Attempting to connect to node=%x (addrs=%v) to "+
"restore ChannelPoint(%v)",
backup.RemoteNodePub.SerializeCompressed(),
lnutils.NewLogClosure(func() string {
return spew.Sdump(backups[i].Addresses)
}), backup.FundingOutpoint)
lnutils.SpewLogClosure(backups[i].Addresses),
backup.FundingOutpoint)
err = peerConnector.ConnectPeer(
backup.RemoteNodePub, backup.Addresses,