mirror of
https://github.com/lightninglabs/loop
synced 2024-11-09 19:10:47 +00:00
Merge pull request #531 from bhandras/p2tr-fixes
sweep: fix sweep fee estimation for p2tr outputs
This commit is contained in:
commit
f5806aebef
@ -192,14 +192,22 @@ func (s *Sweeper) GetSweepFee(ctx context.Context,
|
|||||||
switch destAddr.(type) {
|
switch destAddr.(type) {
|
||||||
case *btcutil.AddressWitnessScriptHash:
|
case *btcutil.AddressWitnessScriptHash:
|
||||||
weightEstimate.AddP2WSHOutput()
|
weightEstimate.AddP2WSHOutput()
|
||||||
|
|
||||||
case *btcutil.AddressWitnessPubKeyHash:
|
case *btcutil.AddressWitnessPubKeyHash:
|
||||||
weightEstimate.AddP2WKHOutput()
|
weightEstimate.AddP2WKHOutput()
|
||||||
|
|
||||||
case *btcutil.AddressScriptHash:
|
case *btcutil.AddressScriptHash:
|
||||||
weightEstimate.AddP2SHOutput()
|
weightEstimate.AddP2SHOutput()
|
||||||
|
|
||||||
case *btcutil.AddressPubKeyHash:
|
case *btcutil.AddressPubKeyHash:
|
||||||
weightEstimate.AddP2PKHOutput()
|
weightEstimate.AddP2PKHOutput()
|
||||||
|
|
||||||
|
case *btcutil.AddressTaproot:
|
||||||
|
weightEstimate.AddP2TROutput()
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0, fmt.Errorf("unknown address type %T", destAddr)
|
return 0, fmt.Errorf("estimate fee: unknown address type %T",
|
||||||
|
destAddr)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = addInputEstimate(&weightEstimate)
|
err = addInputEstimate(&weightEstimate)
|
||||||
|
Loading…
Reference in New Issue
Block a user