Commit 9594b379 authored by Pierre Kim's avatar Pierre Kim
Browse files

Adjust max tx size to avoid stale transactions

parent e76ca883
...@@ -371,9 +371,11 @@ bool Blockchain::haveSpentKeyImages(const CryptoNote::Transaction& tx) { ...@@ -371,9 +371,11 @@ bool Blockchain::haveSpentKeyImages(const CryptoNote::Transaction& tx) {
* \pre m_blockchain_lock is locked * \pre m_blockchain_lock is locked
*/ */
bool Blockchain::checkTransactionSize(size_t blobSize) { bool Blockchain::checkTransactionSize(size_t blobSize) {
if (blobSize > getCurrentCumulativeBlocksizeLimit() - m_currency.minerTxBlobReservedSize()) {
uint64_t TransactionSizeLimit = (getCurrentCumulativeBlocksizeLimit() / 2) - m_currency.minerTxBlobReservedSize();
if (blobSize > TransactionSizeLimit) {
logger(ERROR) << "transaction is too big " << blobSize << ", maximum allowed size is " << logger(ERROR) << "transaction is too big " << blobSize << ", maximum allowed size is " <<
(getCurrentCumulativeBlocksizeLimit() - m_currency.minerTxBlobReservedSize()); (TransactionSizeLimit);
return false; return false;
} }
......
#define BUILD_COMMIT_ID "@VERSION@" #define BUILD_COMMIT_ID "@VERSION@"
#define PROJECT_VERSION "1.2.1" #define PROJECT_VERSION "1.2.1"
#define PROJECT_VERSION_BUILD_NO "0" #define PROJECT_VERSION_BUILD_NO "1"
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment