mirror of
https://github.com/monero-project/monero.git
synced 2024-10-01 11:49:47 -04:00
blockchain_db: sanity check on tx/hash vector sizes
It could trip on a corrupt/crafted file if the user has disabled input verification.
This commit is contained in:
parent
3abd6f1fd0
commit
f9fad18608
@ -194,6 +194,10 @@ uint64_t BlockchainDB::add_block( const block& blk
|
|||||||
, const std::vector<transaction>& txs
|
, const std::vector<transaction>& txs
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
// sanity
|
||||||
|
if (blk.tx_hashes.size() != txs.size())
|
||||||
|
throw new std::runtime_error("Inconsistent tx/hashes sizes");
|
||||||
|
|
||||||
block_txn_start(false);
|
block_txn_start(false);
|
||||||
|
|
||||||
TIME_MEASURE_START(time1);
|
TIME_MEASURE_START(time1);
|
||||||
|
Loading…
Reference in New Issue
Block a user