mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-05-12 12:52:53 +02:00
chanfunding: support p2tr input fee calculation
With this commit we support fee calculation in coin selection for p2tr inputs. We assume that coins in our UTXO selection are only BIP0086 coins. Any other input types with different spend paths won't be selected by the wallet assembler.
This commit is contained in:
parent
10f7213998
commit
8980471d57
@ -79,6 +79,11 @@ func calculateFees(utxos []Coin, feeRate chainfee.SatPerKWeight) (btcutil.Amount
|
||||
case txscript.IsPayToScriptHash(utxo.PkScript):
|
||||
weightEstimate.AddNestedP2WKHInput()
|
||||
|
||||
case txscript.IsPayToTaproot(utxo.PkScript):
|
||||
weightEstimate.AddTaprootKeySpendInput(
|
||||
txscript.SigHashDefault,
|
||||
)
|
||||
|
||||
default:
|
||||
return 0, 0, &errUnsupportedInput{utxo.PkScript}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user