From 8a071078119a6cc026294b5c3ac3abdde5f66ba2 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Tue, 6 May 2025 14:21:39 -0300 Subject: [PATCH] sweepbatcher: make sure dest pkscript is filled --- sweepbatcher/sweep_batch.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sweepbatcher/sweep_batch.go b/sweepbatcher/sweep_batch.go index 049b2cf5..f559d9f8 100644 --- a/sweepbatcher/sweep_batch.go +++ b/sweepbatcher/sweep_batch.go @@ -1285,6 +1285,10 @@ func constructUnsignedTx(sweeps []sweep, address btcutil.Address, return nil, 0, 0, 0, fmt.Errorf("txscript.PayToAddrScript "+ "failed: %w", err) } + if len(batchPkScript) == 0 { + return nil, 0, 0, 0, fmt.Errorf("txscript.PayToAddrScript " + + "returned an empty pkScript") + } // Add the output to weight estimates. err = sweeppkg.AddOutputEstimate(&weightEstimate, address)