From ba03657617a015166dc1e74d15549db8846a53fe Mon Sep 17 00:00:00 2001 From: EmelyanenkoK Date: Fri, 3 Nov 2023 17:05:43 +0300 Subject: [PATCH] Fix transaction credit phase (#797) Co-authored-by: SpyCheese --- crypto/block/transaction.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crypto/block/transaction.cpp b/crypto/block/transaction.cpp index 9df5be132..dba3ce907 100644 --- a/crypto/block/transaction.cpp +++ b/crypto/block/transaction.cpp @@ -955,10 +955,14 @@ bool Transaction::prepare_storage_phase(const StoragePhaseConfig& cfg, bool forc */ bool Transaction::prepare_credit_phase() { credit_phase = std::make_unique(); + // Due payment is only collected in storage phase. + // For messages with bounce flag, contract always receives the amount specified in message // auto collected = std::min(msg_balance_remaining.grams, due_payment); // credit_phase->due_fees_collected = collected; // due_payment -= collected; // credit_phase->credit = msg_balance_remaining -= collected; + credit_phase->due_fees_collected = td::zero_refint(); + credit_phase->credit = msg_balance_remaining; if (!msg_balance_remaining.is_valid()) { LOG(ERROR) << "cannot compute the amount to be credited in the credit phase of transaction"; return false;