pullanchor: account for all anchor outputs.

pull/109/head
ziggie 4 months ago
parent 5cf7fd60c4
commit b777d4436d
No known key found for this signature in database
GPG Key ID: 1AFF9C4DCED6D666

@ -195,7 +195,8 @@ func createPullTransactionTemplate(rootKey *hdkeychain.ExtendedKey,
// Now we can calculate the fee and add the change output.
estimator.AddP2WKHOutput()
totalOutputValue := btcutil.Amount(sponsorTxOut.Value + 330)
anchorAmt := uint64(len(anchorAddrs)) * 330
totalOutputValue := btcutil.Amount(sponsorTxOut.Value + anchorAmt)
feeRateKWeight := chainfee.SatPerKVByte(1000 * feeRate).FeePerKWeight()
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))

Loading…
Cancel
Save