mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-25 20:47:42 +02:00
multi: apply the new type lntypes.WeightUnit
This commit is contained in:
@@ -1737,7 +1737,7 @@ func (w *WalletKit) fundPsbtCoinSelect(account string, changeIndex int32,
|
||||
// Do we already have enough inputs specified to pay for the TX as it
|
||||
// is? In that case we only need to allocate any change, if there is
|
||||
// any.
|
||||
packetFeeNoChange := feeRate.FeeForWeight(int64(estimator.Weight()))
|
||||
packetFeeNoChange := feeRate.FeeForWeight(estimator.Weight())
|
||||
if inputSum >= outputSum+packetFeeNoChange {
|
||||
// Calculate the packet's fee with a change output so, so we can
|
||||
// let the coin selection algorithm decide whether to use a
|
||||
@@ -1749,9 +1749,7 @@ func (w *WalletKit) fundPsbtCoinSelect(account string, changeIndex int32,
|
||||
case chanfunding.P2WKHChangeAddress:
|
||||
estimator.AddP2WKHOutput()
|
||||
}
|
||||
packetFeeWithChange := feeRate.FeeForWeight(
|
||||
int64(estimator.Weight()),
|
||||
)
|
||||
packetFeeWithChange := feeRate.FeeForWeight(estimator.Weight())
|
||||
|
||||
changeAmt, needMore, err := chanfunding.CalculateChangeAmount(
|
||||
inputSum, outputSum, packetFeeNoChange,
|
||||
|
@@ -132,7 +132,7 @@ func TestFundPsbtCoinSelect(t *testing.T) {
|
||||
}
|
||||
|
||||
weight := estimator.Weight()
|
||||
fee := chainfee.FeePerKwFloor.FeeForWeight(int64(weight))
|
||||
fee := chainfee.FeePerKwFloor.FeeForWeight(weight)
|
||||
|
||||
return fee + dust
|
||||
}
|
||||
|
Reference in New Issue
Block a user