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

Deactivate accounts upon destruction in block

This commit is contained in:
OmicronTau 2021-12-31 18:48:51 +03:00 committed by EmelyanenkoK
parent 1b480e39ba
commit 59fcd7cbd5
4 changed files with 45 additions and 30 deletions

View file

@ -1944,7 +1944,6 @@ std::unique_ptr<block::Account> Collator::make_account_from(td::ConstBitPtr addr
}
auto ptr = std::make_unique<block::Account>(workchain(), addr);
if (account.is_null()) {
ptr->created = true;
if (!ptr->init_new(now_)) {
return nullptr;
}
@ -2273,10 +2272,6 @@ Ref<vm::Cell> Collator::create_ordinary_transaction(Ref<vm::Cell> msg_root) {
register_new_msgs(*trans);
update_max_lt(acc->last_trans_end_lt_);
// temporary patch to stop producing dangerous block
if (acc->status == block::Account::acc_nonexist) {
block_full_ = true;
}
return trans_root;
}
@ -2495,10 +2490,6 @@ int Collator::process_one_new_message(block::NewOutMsg msg, bool enqueue_only, R
if (!insert_out_msg(cb.finalize())) {
return -1;
}
// 6.5. check for temporary patch can be left here
if (block_full_) {
return 3;
}
// 7. check whether the block is full now
if (!block_limit_status_->fits(block::ParamLimits::cl_normal)) {
block_full_ = true;

View file

@ -4073,7 +4073,6 @@ std::unique_ptr<block::Account> ValidateQuery::make_account_from(td::ConstBitPtr
Ref<vm::CellSlice> extra) {
auto ptr = std::make_unique<block::Account>(workchain(), addr);
if (account.is_null()) {
ptr->created = true;
if (!ptr->init_new(now_)) {
return nullptr;
}
@ -4308,7 +4307,7 @@ bool ValidateQuery::check_one_transaction(block::Account& account, ton::LogicalT
}
}
if (is_first && is_masterchain() && account.is_special && account.tick &&
(tag != block::gen::TransactionDescr::trans_tick_tock || (td_cs.prefetch_ulong(4) & 1)) && !account.created) {
(tag != block::gen::TransactionDescr::trans_tick_tock || (td_cs.prefetch_ulong(4) & 1)) && account.orig_status == block::Account::acc_active) {
return reject_query(PSTRING() << "transaction " << lt << " of account " << addr.to_hex()
<< " is the first transaction for this special tick account in this block, but the "
"transaction is not a tick transaction");