Merge pull request #5123

089c7637 cryptonote: rework block blob size sanity check (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2019-04-11 12:41:07 +02:00
commit 76fbcfe2dd
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
10 changed files with 100 additions and 16 deletions

View file

@ -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()
};

View file

@ -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;

View file

@ -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);