1
0
Fork 0
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:
sowle 2020-02-13 15:55:58 +03:00
parent e9e61a05d0
commit 2a12f5ecb5
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -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))