Merge pull request #531 from bhandras/p2tr-fixes

sweep: fix sweep fee estimation for p2tr outputs
pull/533/head
András Bánki-Horváth 2 years ago committed by GitHub
commit f5806aebef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -192,14 +192,22 @@ func (s *Sweeper) GetSweepFee(ctx context.Context,
switch destAddr.(type) {
case *btcutil.AddressWitnessScriptHash:
weightEstimate.AddP2WSHOutput()
case *btcutil.AddressWitnessPubKeyHash:
weightEstimate.AddP2WKHOutput()
case *btcutil.AddressScriptHash:
weightEstimate.AddP2SHOutput()
case *btcutil.AddressPubKeyHash:
weightEstimate.AddP2PKHOutput()
case *btcutil.AddressTaproot:
weightEstimate.AddP2TROutput()
default:
return 0, fmt.Errorf("unknown address type %T", destAddr)
return 0, fmt.Errorf("estimate fee: unknown address type %T",
destAddr)
}
err = addInputEstimate(&weightEstimate)

Loading…
Cancel
Save