diff options
author | Riccardo Spagni <ric@spagni.net> | 2019-04-11 12:41:07 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2019-04-11 12:41:07 +0200 |
commit | 76fbcfe2ddf597b4d8f6d2f5e6f387d57db427eb (patch) | |
tree | 4d9fdf15d9e1eab2482dd11e3c8d2e69864e1765 /src/cryptonote_basic | |
parent | Merge pull request #4939 (diff) | |
parent | cryptonote: rework block blob size sanity check (diff) | |
download | monero-76fbcfe2ddf597b4d8f6d2f5e6f387d57db427eb.tar.xz |
Merge pull request #5123
089c7637 cryptonote: rework block blob size sanity check (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_basic')
-rw-r--r-- | src/cryptonote_basic/cryptonote_basic.h | 2 | ||||
-rw-r--r-- | src/cryptonote_basic/cryptonote_basic_impl.cpp | 5 | ||||
-rw-r--r-- | src/cryptonote_basic/cryptonote_basic_impl.h | 1 |
3 files changed, 2 insertions, 6 deletions
diff --git a/src/cryptonote_basic/cryptonote_basic.h b/src/cryptonote_basic/cryptonote_basic.h index 03caafbb0..20d92bdf1 100644 --- a/src/cryptonote_basic/cryptonote_basic.h +++ b/src/cryptonote_basic/cryptonote_basic.h @@ -422,6 +422,8 @@ namespace cryptonote FIELDS(*static_cast<block_header *>(this)) FIELD(miner_tx) FIELD(tx_hashes) + if (tx_hashes.size() > CRYPTONOTE_MAX_TX_PER_BLOCK) + return false; END_SERIALIZE() }; diff --git a/src/cryptonote_basic/cryptonote_basic_impl.cpp b/src/cryptonote_basic/cryptonote_basic_impl.cpp index e336cc1d1..d8de65b81 100644 --- a/src/cryptonote_basic/cryptonote_basic_impl.cpp +++ b/src/cryptonote_basic/cryptonote_basic_impl.cpp @@ -76,11 +76,6 @@ namespace cryptonote { return CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5; } //----------------------------------------------------------------------------------------------- - size_t get_max_block_size() - { - return CRYPTONOTE_MAX_BLOCK_SIZE; - } - //----------------------------------------------------------------------------------------------- size_t get_max_tx_size() { return CRYPTONOTE_MAX_TX_SIZE; diff --git a/src/cryptonote_basic/cryptonote_basic_impl.h b/src/cryptonote_basic/cryptonote_basic_impl.h index 036273f0e..c7198a16f 100644 --- a/src/cryptonote_basic/cryptonote_basic_impl.h +++ b/src/cryptonote_basic/cryptonote_basic_impl.h @@ -87,7 +87,6 @@ namespace cryptonote { /* Cryptonote helper functions */ /************************************************************************/ size_t get_min_block_weight(uint8_t version); - size_t get_max_block_size(); size_t get_max_tx_size(); bool get_block_reward(size_t median_weight, size_t current_block_weight, uint64_t already_generated_coins, uint64_t &reward, uint8_t version); uint8_t get_account_address_checksum(const public_address_outer_blob& bl); |