diff options
author | luigi1111 <luigi1111w@gmail.com> | 2023-03-18 18:18:13 -0400 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2023-03-18 18:18:13 -0400 |
commit | 76dd14dfb1c948497748ab1ef74d182973f67219 (patch) | |
tree | 75b40b66fb7bafadf903d292975de56ba369c22b /src/cryptonote_core/tx_pool.cpp | |
parent | Merge pull request #8707 (diff) | |
parent | Add a size limit for tx_extra in tx pool (diff) | |
download | monero-76dd14dfb1c948497748ab1ef74d182973f67219.tar.xz |
Merge pull request #8733
3771641 Add a size limit for tx_extra in tx pool (tevador)
Diffstat (limited to 'src/cryptonote_core/tx_pool.cpp')
-rw-r--r-- | src/cryptonote_core/tx_pool.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 3a058ad66..656d5bfd3 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -224,6 +224,15 @@ namespace cryptonote return false; } + size_t tx_extra_size = tx.extra.size(); + if (!kept_by_block && tx_extra_size > MAX_TX_EXTRA_SIZE) + { + LOG_PRINT_L1("transaction tx-extra is too big: " << tx_extra_size << " bytes, the limit is: " << MAX_TX_EXTRA_SIZE); + tvc.m_verifivation_failed = true; + tvc.m_tx_extra_too_big = true; + return false; + } + // if the transaction came from a block popped from the chain, // don't check if we have its key images as spent. // TODO: Investigate why not? |