aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/tx_pool.cpp
diff options
context:
space:
mode:
authortevador <tevador@gmail.com>2023-02-05 21:53:32 +0100
committertevador <tevador@gmail.com>2023-02-26 10:26:53 +0100
commit3771641fc5f40cee20df297f49f0dc2213947a45 (patch)
tree22e57d912b2cb8248f8809d21cd1e40968bc9e60 /src/cryptonote_core/tx_pool.cpp
parentMerge pull request #8675 (diff)
downloadmonero-3771641fc5f40cee20df297f49f0dc2213947a45.tar.xz
Add a size limit for tx_extra in tx pool
Diffstat (limited to 'src/cryptonote_core/tx_pool.cpp')
-rw-r--r--src/cryptonote_core/tx_pool.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp
index 3346a9aba..7268eaf3c 100644
--- a/src/cryptonote_core/tx_pool.cpp
+++ b/src/cryptonote_core/tx_pool.cpp
@@ -218,6 +218,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?