From a4c0d85bbb1b7ac5a17d2b9bc47f552b0bd5a9b2 Mon Sep 17 00:00:00 2001 From: Some Random Crypto Guy Date: Tue, 5 Aug 2025 14:07:26 +0100 Subject: [PATCH] fixed stake/burn TX amount - stopped fees being deducted from amount_burnt --- src/carrot_impl/tx_proposal_utils.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/carrot_impl/tx_proposal_utils.cpp b/src/carrot_impl/tx_proposal_utils.cpp index 5bdebbf..3cde12a 100644 --- a/src/carrot_impl/tx_proposal_utils.cpp +++ b/src/carrot_impl/tx_proposal_utils.cpp @@ -331,15 +331,6 @@ void make_carrot_transaction_proposal_v1_transfer( selfsend_payment_proposals.back().proposal.amount = boost::numeric_cast(implicit_change_amount); - // remove the self send payment we have made to ourself now that we have our change payment. - if (tx_type == cryptonote::transaction_type::STAKE || - tx_type == cryptonote::transaction_type::BURN) - { - selfsend_payment_proposals.back().proposal.enote_ephemeral_pubkey = - selfsend_payment_proposals.front().proposal.enote_ephemeral_pubkey; - selfsend_payment_proposals.erase(selfsend_payment_proposals.begin()); - } - // deduct an even fee amount from all subtractable outputs const size_t num_subtractble_normal = subtractable_normal_payment_proposals.size(); const size_t num_subtractable_selfsend = subtractable_selfsend_payment_proposals.size(); @@ -403,6 +394,16 @@ void make_carrot_transaction_proposal_v1_transfer( CHECK_AND_ASSERT_THROW_MES(fee_remainder == 0, "make unsigned transaction transfer subtractable: bug: fee remainder at end of carve function"); + + // remove the self send payment we have made to ourself now that we have our change payment. + if (tx_type == cryptonote::transaction_type::STAKE || + tx_type == cryptonote::transaction_type::BURN) + { + selfsend_payment_proposals.back().proposal.enote_ephemeral_pubkey = + selfsend_payment_proposals.front().proposal.enote_ephemeral_pubkey; + selfsend_payment_proposals.erase(selfsend_payment_proposals.begin()); + } + }; //end carve_fees_and_balance // make unsigned transaction with fee carving callback