@@ -727,10 +727,11 @@ func (b *batch) publishBatch(ctx context.Context) (btcutil.Amount, error) {
727
727
728
728
weightEstimate .AddP2TROutput ()
729
729
730
- fee = b .rbfCache .FeeRate .FeeForWeight (weightEstimate .Weight ())
730
+ weight := weightEstimate .Weight ()
731
+ feeForWeight := b .rbfCache .FeeRate .FeeForWeight (weight )
731
732
732
733
// Clamp the calculated fee to the max allowed fee amount for the batch.
733
- fee = clampBatchFee (fee , batchAmt )
734
+ fee = clampBatchFee (feeForWeight , batchAmt )
734
735
735
736
// Add the batch transaction output, which excludes the fees paid to
736
737
// miners.
@@ -761,8 +762,9 @@ func (b *batch) publishBatch(ctx context.Context) (btcutil.Amount, error) {
761
762
}
762
763
763
764
b .log .Infof ("attempting to publish non-coop tx=%v with feerate=%v, " +
764
- "totalfee=%v, sweeps=%d, destAddr=%s" , batchTx .TxHash (),
765
- b .rbfCache .FeeRate , fee , len (batchTx .TxIn ), address )
765
+ "weight=%v, feeForWeight=%v, fee=%v, sweeps=%d, destAddr=%s" ,
766
+ batchTx .TxHash (), b .rbfCache .FeeRate , weight , feeForWeight , fee ,
767
+ len (batchTx .TxIn ), address )
766
768
767
769
b .debugLogTx ("serialized non-coop sweep" , batchTx )
768
770
@@ -857,10 +859,11 @@ func (b *batch) publishBatchCoop(ctx context.Context) (btcutil.Amount,
857
859
858
860
weightEstimate .AddP2TROutput ()
859
861
860
- fee = b .rbfCache .FeeRate .FeeForWeight (weightEstimate .Weight ())
862
+ weight := weightEstimate .Weight ()
863
+ feeForWeight := b .rbfCache .FeeRate .FeeForWeight (weight )
861
864
862
865
// Clamp the calculated fee to the max allowed fee amount for the batch.
863
- fee = clampBatchFee (fee , batchAmt )
866
+ fee = clampBatchFee (feeForWeight , batchAmt )
864
867
865
868
// Add the batch transaction output, which excludes the fees paid to
866
869
// miners.
@@ -905,8 +908,9 @@ func (b *batch) publishBatchCoop(ctx context.Context) (btcutil.Amount,
905
908
}
906
909
907
910
b .log .Infof ("attempting to publish coop tx=%v with feerate=%v, " +
908
- "totalfee=%v, sweeps=%d, destAddr=%s" , batchTx .TxHash (),
909
- b .rbfCache .FeeRate , fee , len (batchTx .TxIn ), address )
911
+ "weight=%v, feeForWeight=%v, fee=%v, sweeps=%d, destAddr=%s" ,
912
+ batchTx .TxHash (), b .rbfCache .FeeRate , weight , feeForWeight , fee ,
913
+ len (batchTx .TxIn ), address )
910
914
911
915
b .debugLogTx ("serialized coop sweep" , batchTx )
912
916
0 commit comments