Move TX_MAX_STANDARD_VERSION to policy

Also remove extraneous whitespace, should be reviewed with --ignore-all-space
This commit is contained in:
MarcoFalke
2020-12-10 11:21:33 +01:00
parent 38176dc665
commit fade6195b1
4 changed files with 28 additions and 25 deletions

View File

@ -11,6 +11,7 @@
#include <consensus/consensus.h>
#include <core_io.h>
#include <key_io.h>
#include <policy/policy.h>
#include <policy/rbf.h>
#include <primitives/transaction.h>
#include <script/script.h>
@ -196,8 +197,9 @@ static CAmount ExtractAndValidateValue(const std::string& strValue)
static void MutateTxVersion(CMutableTransaction& tx, const std::string& cmdVal)
{
int64_t newVersion;
if (!ParseInt64(cmdVal, &newVersion) || newVersion < 1 || newVersion > CTransaction::MAX_STANDARD_VERSION)
if (!ParseInt64(cmdVal, &newVersion) || newVersion < 1 || newVersion > TX_MAX_STANDARD_VERSION) {
throw std::runtime_error("Invalid TX version requested: '" + cmdVal + "'");
}
tx.nVersion = (int) newVersion;
}