rpc: sanity check on number of txes in a block

This commit is contained in:
moneromooo-monero 2018-04-15 22:17:58 +01:00
parent 6795bd0d4e
commit 209ec963b5
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

View File

@ -258,6 +258,12 @@ namespace cryptonote
return false; 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; size_t txidx = 0;
ntxes += bd.second.size(); ntxes += bd.second.size();
for (std::list<cryptonote::blobdata>::iterator i = bd.second.begin(); i != bd.second.end(); ++i) for (std::list<cryptonote::blobdata>::iterator i = bd.second.begin(); i != bd.second.end(); ++i)