forked from lthn/blockchain
tx pool: new soft rule: standalone txs will be rejected while BCS is in CP zone (more security when checkpoints will be enabled)
(also, this should fix gen_checkpoints_and_invalid_tx_to_pool test that was especially written to cover this case)
This commit is contained in:
parent
e9e61a05d0
commit
2a12f5ecb5
1 changed files with 10 additions and 0 deletions
|
|
@ -91,6 +91,16 @@ namespace currency
|
|||
//---------------------------------------------------------------------------------
|
||||
bool tx_memory_pool::add_tx(const transaction &tx, const crypto::hash &id, uint64_t blob_size, tx_verification_context& tvc, bool kept_by_block, bool from_core)
|
||||
{
|
||||
if (!kept_by_block && !from_core && m_blockchain.is_in_checkpoint_zone())
|
||||
{
|
||||
// BCS is in CP zone, tx verification is impossible until it gets synchronized
|
||||
tvc.m_added_to_pool = false;
|
||||
tvc.m_should_be_relayed = false;
|
||||
tvc.m_verification_failed = false;
|
||||
tvc.m_verification_impossible = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
TIME_MEASURE_START_PD(tx_processing_time);
|
||||
TIME_MEASURE_START_PD(check_inputs_types_supported_time);
|
||||
if(!check_inputs_types_supported(tx))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue