aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-04-15 22:17:58 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-06-26 22:14:18 +0100
commit209ec963b5ed0a3ad98f159b9f500c28bb3e7d78 (patch)
tree51a078ad4e1d93f59fab4f5b58cebc36c41affaf
parentrpc: add option to skip coinbase info in get_blocks.bin (diff)
downloadmonero-209ec963b5ed0a3ad98f159b9f500c28bb3e7d78.tar.xz
rpc: sanity check on number of txes in a block
-rw-r--r--src/rpc/core_rpc_server.cpp6
1 files changed, 6 insertions, 0 deletions
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<cryptonote::blobdata>::iterator i = bd.second.begin(); i != bd.second.end(); ++i)