From 209ec963b5ed0a3ad98f159b9f500c28bb3e7d78 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 15 Apr 2018 22:17:58 +0100 Subject: rpc: sanity check on number of txes in a block --- src/rpc/core_rpc_server.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 4c14e5c64..83cf5ba3c 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -258,6 +258,12 @@ namespace cryptonote return false; } } + if(b.tx_hashes.size() != bd.second.size()) + { + MERROR("block " << get_block_hash(b) << ": tx_hashes.size() " << b.tx_hashes.size() << ", bd.second.size() " << bd.second.size()); + res.status = "Failed"; + return false; + } size_t txidx = 0; ntxes += bd.second.size(); for (std::list::iterator i = bd.second.begin(); i != bd.second.end(); ++i) -- cgit v1.2.3