sweepbatcher: make sure dest pkscript is filled

This commit is contained in:
Boris Nagaev 2025-05-06 14:21:39 -03:00
parent 8c784ef761
commit 8a07107811
No known key found for this signature in database

View file

@ -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)