From 80bd2d1ff0abd21195dfa0ea6b3b0fb7ee84bf4c Mon Sep 17 00:00:00 2001 From: Some Random Crypto Guy Date: Mon, 4 Aug 2025 11:01:33 +0100 Subject: [PATCH] fixed calculation for Carrot TX sizes - added Salvium-specific data --- src/carrot_impl/tx_proposal_utils.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/carrot_impl/tx_proposal_utils.h b/src/carrot_impl/tx_proposal_utils.h index cd6aa04de..f35407614 100644 --- a/src/carrot_impl/tx_proposal_utils.h +++ b/src/carrot_impl/tx_proposal_utils.h @@ -92,19 +92,26 @@ static size_t estimate_rct_tx_size_carrot(int n_inputs, int mixin, int n_outputs size += 1 + 6; // vin - size += n_inputs * (1+6+4+(mixin+1)*2+32); + size += n_inputs * (1+1+4+(mixin+1)*2+32); // vout - size += n_outputs * (3+4+16+32); + size += n_outputs * (1+1+32+4+3+16); // extra size += extra_size; - // rct signatures - // type size += 1; + // amount_burnt + size += 8; + + // return_address data + // NOTE: this will be wrong by 21 bytes for STAKE TXs using `protocol_tx_data_t` + size += n_outputs * (32 + 1); + + // rct signatures + // rangeSigs if (bulletproof || bulletproof_plus) {