mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Correct Monero's extra length calculation for fee calculation
This commit is contained in:
@@ -220,8 +220,11 @@ impl SignableTransaction {
|
||||
}
|
||||
let mut outputs = payments.len() + (if change { 1 } else { 0 });
|
||||
|
||||
// Calculate the extra length.
|
||||
// Type, length, value, with 1 field for the first key and 1 field for the rest
|
||||
let extra = (outputs * (2 + 32)) - (outputs.saturating_sub(2) * 2);
|
||||
|
||||
// Calculate the fee.
|
||||
let extra = 0;
|
||||
let mut fee = fee_rate.calculate(Transaction::fee_weight(inputs.len(), outputs, extra));
|
||||
|
||||
// Make sure we have enough funds
|
||||
|
||||
Reference in New Issue
Block a user