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

Add fee burning and blackhole address (#703)

* Fix tlbc crash

* Burn specified fraction of fees

* Add "blackhole" for burning TONs

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
EmelyanenkoK 2023-05-18 11:26:02 +03:00 committed by GitHub
parent d5cd548502
commit ef64b92f08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 187 additions and 57 deletions

View file

@ -672,6 +672,12 @@ bool Transaction::unpack_input_msg(bool ihr_delivered, const ActionPhaseConfig*
return false;
}
total_fees += in_fwd_fee;
if (account.workchain == ton::masterchainId && cfg->mc_blackhole_addr &&
cfg->mc_blackhole_addr.value() == account.addr) {
blackhole_burned.grams = msg_balance_remaining.grams;
msg_balance_remaining.grams = td::zero_refint();
LOG(DEBUG) << "Burning " << blackhole_burned.grams << " nanoton (blackhole address)";
}
return true;
}
@ -2618,6 +2624,7 @@ td::Status FetchConfigParams::fetch_config_params(const block::Config& config,
action_phase_cfg->workchains = &config.get_workchain_list();
action_phase_cfg->bounce_msg_body = (config.has_capability(ton::capBounceMsgBody) ? 256 : 0);
action_phase_cfg->size_limits = size_limits;
action_phase_cfg->mc_blackhole_addr = config.get_burning_config().blackhole_addr;
}
{
// fetch block_grams_created