diff options
| author | Alexander Blair <snipa@jagtech.io> | 2020-12-29 10:48:05 -0800 |
|---|---|---|
| committer | Alexander Blair <snipa@jagtech.io> | 2020-12-29 10:48:05 -0800 |
| commit | 36dfd41e01ebc852e094f268433344404c042591 (patch) | |
| tree | 35a6905e952e09be11f8d037f73d098e21047489 /src/rpc/core_rpc_server.cpp | |
| parent | bcd7f63a54fdc2b01ab6e8b175760903462cd1fc (diff) | |
| parent | 218a109677914c69797d5ed55167d973b8837fde (diff) | |
| download | monzero-core-0.17.1.8.tar.gz monzero-core-0.17.1.8.tar.xz monzero-core-0.17.1.8.zip | |
Merge pull request #7222v0.17.1.8
218a10967 rpc: limit the number of txes for get_blocks.bin (moneromooo-monero)
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
| -rw-r--r-- | src/rpc/core_rpc_server.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 1abeb3903..664f058e2 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -565,12 +565,12 @@ namespace cryptonote } } - size_t max_blocks = COMMAND_RPC_GET_BLOCKS_FAST_MAX_COUNT; + size_t max_blocks = COMMAND_RPC_GET_BLOCKS_FAST_MAX_BLOCK_COUNT; if (m_rpc_payment) { max_blocks = res.credits / COST_PER_BLOCK; - if (max_blocks > COMMAND_RPC_GET_BLOCKS_FAST_MAX_COUNT) - max_blocks = COMMAND_RPC_GET_BLOCKS_FAST_MAX_COUNT; + if (max_blocks > COMMAND_RPC_GET_BLOCKS_FAST_MAX_BLOCK_COUNT) + max_blocks = COMMAND_RPC_GET_BLOCKS_FAST_MAX_BLOCK_COUNT; if (max_blocks == 0) { res.status = CORE_RPC_STATUS_PAYMENT_REQUIRED; @@ -579,7 +579,7 @@ namespace cryptonote } std::vector<std::pair<std::pair<cryptonote::blobdata, crypto::hash>, std::vector<std::pair<crypto::hash, cryptonote::blobdata> > > > bs; - if(!m_core.find_blockchain_supplement(req.start_height, req.block_ids, bs, res.current_height, res.start_height, req.prune, !req.no_miner_tx, max_blocks)) + if(!m_core.find_blockchain_supplement(req.start_height, req.block_ids, bs, res.current_height, res.start_height, req.prune, !req.no_miner_tx, max_blocks, COMMAND_RPC_GET_BLOCKS_FAST_MAX_TX_COUNT)) { res.status = "Failed"; add_host_fail(ctx); |
