Use chainparams passed into ATMPW

This commit is contained in:
UdjinM6 2019-09-08 22:37:00 +03:00 committed by Pasta
parent e6df5690a2
commit a7e20cd4c2
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -523,7 +523,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
if (!CheckTransaction(tx, state))
return false; // state filled in by CheckTransaction
if (!ContextualCheckTransaction(tx, state, Params().GetConsensus(), chainActive.Tip()))
if (!ContextualCheckTransaction(tx, state, chainparams.GetConsensus(), chainActive.Tip()))
return error("%s: ContextualCheckTransaction: %s, %s", __func__, hash.ToString(), FormatStateMessage(state));
if (tx.nVersion == 3 && tx.nType == TRANSACTION_QUORUM_COMMITMENT) {
@ -555,7 +555,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
if (conflictLock) {
CTransactionRef txConflict;
uint256 hashBlock;
if (GetTransaction(conflictLock->txid, txConflict, Params().GetConsensus(), hashBlock)) {
if (GetTransaction(conflictLock->txid, txConflict, chainparams.GetConsensus(), hashBlock)) {
GetMainSignals().NotifyInstantSendDoubleSpendAttempt(tx, *txConflict);
}
return state.DoS(10, error("AcceptToMemoryPool : Transaction %s conflicts with locked TX %s",
@ -726,7 +726,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
// There is a similar check in CreateNewBlock() to prevent creating
// invalid blocks (using TestBlockValidity), however allowing such
// transactions into the mempool can be exploited as a DoS attack.
unsigned int currentBlockScriptVerifyFlags = GetBlockScriptFlags(chainActive.Tip(), Params().GetConsensus());
unsigned int currentBlockScriptVerifyFlags = GetBlockScriptFlags(chainActive.Tip(), chainparams.GetConsensus());
if (!CheckInputsFromMempoolAndCache(tx, state, view, pool, currentBlockScriptVerifyFlags, true, txdata)) {
return error("%s: BUG! PLEASE REPORT THIS! CheckInputs failed against latest-block but not STANDARD flags %s, %s",
__func__, hash.ToString(), FormatStateMessage(state));