forked from lthn/blockchain
extended limitations on NOTIFY_REQUEST_GET_OBJECTS
This commit is contained in:
parent
26addb2f53
commit
87dfca56a3
2 changed files with 4 additions and 3 deletions
|
|
@ -1,5 +1,4 @@
|
|||
// Copyright (c) 2014-2018 Zano Project
|
||||
// Copyright (c) 2014-2018 Zano Project
|
||||
// Copyright (c) 2014-2018 The Louisdor Project
|
||||
// Copyright (c) 2012-2013 The Cryptonote developers
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
|
|
@ -98,7 +97,8 @@
|
|||
#define BLOCKS_IDS_SYNCHRONIZING_DEFAULT_COUNT 2000 //by default, blocks ids count in synchronizing
|
||||
#define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT 200 //by default, blocks count in blocks downloading
|
||||
#define BLOCKS_SYNCHRONIZING_DEFAULT_SIZE 2000000 //by default keep synchronizing packets not bigger then 2MB
|
||||
#define CURRENCY_PROTOCOL_MAX_BLOCKS_REQUEST_COUNT 500
|
||||
#define CURRENCY_PROTOCOL_MAX_BLOCKS_REQUEST_COUNT 500
|
||||
#define CURRENCY_PROTOCOL_MAX_TXS_REQUEST_COUNT 500
|
||||
|
||||
|
||||
#define CURRENCY_ALT_BLOCK_LIVETIME_COUNT (CURRENCY_BLOCKS_PER_DAY*7)//one week
|
||||
|
|
|
|||
|
|
@ -361,7 +361,8 @@ namespace currency
|
|||
LOG_PRINT_L2("[HANDLE]NOTIFY_REQUEST_GET_OBJECTS: arg.blocks.size() = " << arg.blocks.size() << ", arg.txs.size()="<< arg.txs.size());
|
||||
LOG_PRINT_L3("[HANDLE]NOTIFY_REQUEST_GET_OBJECTS: " << ENDL << currency::print_kv_structure(arg));
|
||||
|
||||
if (arg.blocks.size() > CURRENCY_PROTOCOL_MAX_BLOCKS_REQUEST_COUNT)
|
||||
if (arg.blocks.size() > CURRENCY_PROTOCOL_MAX_BLOCKS_REQUEST_COUNT ||
|
||||
arg.txs.size() > CURRENCY_PROTOCOL_MAX_TXS_REQUEST_COUNT)
|
||||
{
|
||||
LOG_ERROR_CCONTEXT("Requested objects count is to big (" << arg.blocks.size() <<")expected not more then " << CURRENCY_PROTOCOL_MAX_BLOCKS_REQUEST_COUNT);
|
||||
m_p2p->drop_connection(context);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue