Merge pull request #109 from ziggie1984/bug-fix-anchor-amt

pullanchor: account for all anchor outputs.
pull/114/head
Oliver Gugger 4 months ago committed by GitHub
commit 858995a317
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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