未验证 提交 517fd2c9 编写于 作者: K Kevin Heifner 提交者: GitHub

Merge pull request #6881 from EOSIO/feature/1.6.3-security-omnibus

Consolidated Security Fixes for 1.6.3
......@@ -1040,9 +1040,7 @@ struct controller_impl {
recovered_keys,
{},
trx_context.delay,
[](){}
/*std::bind(&transaction_context::add_cpu_usage_and_check_time, &trx_context,
std::placeholders::_1)*/,
[&trx_context](){ trx_context.checktime(); },
false
);
}
......
......@@ -724,6 +724,7 @@ namespace eosio {
void rejected_block(const block_id_type& id);
void recv_block(const connection_ptr& conn, const block_id_type& msg, uint32_t bnum);
void expire_blocks( uint32_t bnum );
void recv_transaction(const connection_ptr& conn, const transaction_id_type& id);
void recv_notice(const connection_ptr& conn, const notice_message& msg, bool generated);
......@@ -1656,11 +1657,23 @@ namespace eosio {
}
void dispatch_manager::rejected_block(const block_id_type& id) {
fc_dlog(logger,"not sending rejected transaction ${tid}",("tid",id));
fc_dlog( logger, "rejected block ${id}", ("id", id) );
auto range = received_blocks.equal_range(id);
received_blocks.erase(range.first, range.second);
}
void dispatch_manager::expire_blocks( uint32_t lib_num ) {
for( auto i = received_blocks.begin(); i != received_blocks.end(); ) {
const block_id_type& blk_id = i->first;
uint32_t blk_num = block_header::num_from_id( blk_id );
if( blk_num <= lib_num ) {
i = received_blocks.erase( i );
} else {
++i;
}
}
}
void dispatch_manager::bcast_transaction(const transaction_metadata_ptr& ptrx) {
std::set<connection_ptr> skips;
const auto& id = ptrx->id;
......@@ -2565,6 +2578,7 @@ namespace eosio {
}
else {
sync_master->rejected_block(c, blk_num);
dispatcher->rejected_block( blk_id );
}
}
......@@ -2626,6 +2640,7 @@ namespace eosio {
controller& cc = chain_plug->chain();
uint32_t lib = cc.last_irreversible_block_num();
dispatcher->expire_blocks( lib );
for ( auto &c : connections ) {
auto &stale_txn = c->trx_state.get<by_block_num>();
stale_txn.erase( stale_txn.lower_bound(1), stale_txn.upper_bound(lib) );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册