Skip to content

Commit 858995a

Browse files
authored
Merge pull request #109 from ziggie1984/bug-fix-anchor-amt
pullanchor: account for all anchor outputs.
2 parents 5cf7fd6 + b777d44 commit 858995a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/chantools/pullanchor.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ func createPullTransactionTemplate(rootKey *hdkeychain.ExtendedKey,
195195

196196
// Now we can calculate the fee and add the change output.
197197
estimator.AddP2WKHOutput()
198-
totalOutputValue := btcutil.Amount(sponsorTxOut.Value + 330)
198+
anchorAmt := uint64(len(anchorAddrs)) * 330
199+
totalOutputValue := btcutil.Amount(sponsorTxOut.Value + anchorAmt)
199200
feeRateKWeight := chainfee.SatPerKVByte(1000 * feeRate).FeePerKWeight()
200201
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
201202

0 commit comments

Comments
 (0)