Skip to content

Commit

Permalink
Fix transaction credit phase (ton-blockchain#797)
Browse files Browse the repository at this point in the history
Co-authored-by: SpyCheese <[email protected]>
  • Loading branch information
EmelyanenkoK and SpyCheese authored Nov 3, 2023
1 parent 79ed14c commit ba03657
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crypto/block/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,10 +955,14 @@ bool Transaction::prepare_storage_phase(const StoragePhaseConfig& cfg, bool forc
*/
bool Transaction::prepare_credit_phase() {
credit_phase = std::make_unique<CreditPhase>();
// 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;
Expand Down

0 comments on commit ba03657

Please sign in to comment.