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:
parent
79ed14cba9
commit
ba03657617
1 changed files with 4 additions and 0 deletions
|
@ -955,10 +955,14 @@ bool Transaction::prepare_storage_phase(const StoragePhaseConfig& cfg, bool forc
|
||||||
*/
|
*/
|
||||||
bool Transaction::prepare_credit_phase() {
|
bool Transaction::prepare_credit_phase() {
|
||||||
credit_phase = std::make_unique<CreditPhase>();
|
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);
|
// auto collected = std::min(msg_balance_remaining.grams, due_payment);
|
||||||
// credit_phase->due_fees_collected = collected;
|
// credit_phase->due_fees_collected = collected;
|
||||||
// due_payment -= collected;
|
// due_payment -= collected;
|
||||||
// credit_phase->credit = msg_balance_remaining -= 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()) {
|
if (!msg_balance_remaining.is_valid()) {
|
||||||
LOG(ERROR) << "cannot compute the amount to be credited in the credit phase of transaction";
|
LOG(ERROR) << "cannot compute the amount to be credited in the credit phase of transaction";
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue