Skip to content

Commit f5806ae

Browse files
authored
Merge pull request #531 from bhandras/p2tr-fixes
sweep: fix sweep fee estimation for p2tr outputs
2 parents 2352310 + 8d21042 commit f5806ae

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

sweep/sweeper.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,22 @@ func (s *Sweeper) GetSweepFee(ctx context.Context,
192192
switch destAddr.(type) {
193193
case *btcutil.AddressWitnessScriptHash:
194194
weightEstimate.AddP2WSHOutput()
195+
195196
case *btcutil.AddressWitnessPubKeyHash:
196197
weightEstimate.AddP2WKHOutput()
198+
197199
case *btcutil.AddressScriptHash:
198200
weightEstimate.AddP2SHOutput()
201+
199202
case *btcutil.AddressPubKeyHash:
200203
weightEstimate.AddP2PKHOutput()
204+
205+
case *btcutil.AddressTaproot:
206+
weightEstimate.AddP2TROutput()
207+
201208
default:
202-
return 0, fmt.Errorf("unknown address type %T", destAddr)
209+
return 0, fmt.Errorf("estimate fee: unknown address type %T",
210+
destAddr)
203211
}
204212

205213
err = addInputEstimate(&weightEstimate)

0 commit comments

Comments
 (0)