aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/tx_pool.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2023-03-18 18:23:14 -0400
committerluigi1111 <luigi1111w@gmail.com>2023-03-18 18:23:14 -0400
commit225e5ba571264eb9ceb1e7defa732d8ea28ab5cb (patch)
tree0ad4ec7c9845447eff358f6a863b7c981e584a97 /src/cryptonote_core/tx_pool.cpp
parent66f57299a220db539fdfb280c27483660664875d (diff)
parent5900ed3706caa1beeef88738e7b62194280af5d9 (diff)
downloadmonzero-core-225e5ba571264eb9ceb1e7defa732d8ea28ab5cb.tar.gz
monzero-core-225e5ba571264eb9ceb1e7defa732d8ea28ab5cb.tar.xz
monzero-core-225e5ba571264eb9ceb1e7defa732d8ea28ab5cb.zip
Merge pull request #8784
5900ed3 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.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 2a514ceae..359ded875 100644
--- a/src/cryptonote_core/tx_pool.cpp
+++ b/src/cryptonote_core/tx_pool.cpp
@@ -219,6 +219,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?