Skip to content

Commit

Permalink
Merge pull request #109 from ziggie1984/bug-fix-anchor-amt
Browse files Browse the repository at this point in the history
pullanchor: account for all anchor outputs.
  • Loading branch information
guggero authored Jan 3, 2024
2 parents 5cf7fd6 + b777d44 commit 858995a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/chantools/pullanchor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()))

Expand Down

0 comments on commit 858995a

Please sign in to comment.