From b777d4436de9af2dc924b139dd302280496d5b61 Mon Sep 17 00:00:00 2001 From: ziggie Date: Tue, 2 Jan 2024 14:49:52 +0100 Subject: [PATCH] pullanchor: account for all anchor outputs. --- cmd/chantools/pullanchor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/chantools/pullanchor.go b/cmd/chantools/pullanchor.go index 8183717..7a4f890 100644 --- a/cmd/chantools/pullanchor.go +++ b/cmd/chantools/pullanchor.go @@ -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()))