Skip to content

Commit 32cc090

Browse files
committed
sweepbatcher: more logging in PresignSweepsGroup
1 parent 846246e commit 32cc090

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

sweepbatcher/sweep_batcher.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package sweepbatcher
22

33
import (
44
"context"
5+
"encoding/hex"
56
"errors"
67
"fmt"
78
"strings"
@@ -12,6 +13,7 @@ import (
1213
"github.com/btcsuite/btcd/btcutil"
1314
"github.com/btcsuite/btcd/chaincfg"
1415
"github.com/btcsuite/btcd/chaincfg/chainhash"
16+
"github.com/btcsuite/btcd/txscript"
1517
"github.com/btcsuite/btcd/wire"
1618
"github.com/btcsuite/btclog/v2"
1719
"github.com/btcsuite/btcwallet/chain"
@@ -683,7 +685,14 @@ func (b *Batcher) PresignSweepsGroup(ctx context.Context, inputs []Input,
683685
if err != nil {
684686
return fmt.Errorf("failed to get nextBlockFeeRate: %w", err)
685687
}
686-
infof("PresignSweepsGroup: nextBlockFeeRate is %v", nextBlockFeeRate)
688+
destPkscript, err := txscript.PayToAddrScript(destAddress)
689+
if err != nil {
690+
return fmt.Errorf("txscript.PayToAddrScript failed: %w", err)
691+
}
692+
infof("PresignSweepsGroup: nextBlockFeeRate is %v, inputs: %v, "+
693+
"destAddress: %v, destPkscript: %v sweepTimeout: %d",
694+
nextBlockFeeRate, inputs, destAddress,
695+
hex.EncodeToString(destPkscript), sweepTimeout)
687696

688697
sweeps := make([]sweep, len(inputs))
689698
for i, input := range inputs {

0 commit comments

Comments
 (0)