1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Fix transaction credit phase (#797)

Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
EmelyanenkoK 2023-11-03 17:05:43 +03:00 committed by GitHub
parent 79ed14cba9
commit ba03657617
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;