mempool: Remove duplicate consensusBranchId from AcceptToMemoryPool

This commit is contained in:
Jack Grigg 2020-02-21 15:50:23 +00:00
parent 6bec5685b6
commit 4441b7bcb4
1 changed files with 5 additions and 5 deletions

View File

@ -1327,6 +1327,8 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
*pfMissingInputs = false;
int nextBlockHeight = chainActive.Height() + 1;
// Grab the branch ID we expect this transaction to commit to.
auto consensusBranchId = CurrentEpochBranchId(nextBlockHeight, Params().GetConsensus());
if (pool.IsRecentlyEvicted(tx.GetHash())) {
@ -1475,11 +1477,9 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
}
}
// Grab the branch ID we expect this transaction to commit to. We don't
// yet know if it does, but if the entry gets added to the mempool, then
// it has passed ContextualCheckInputs and therefore this is correct.
auto consensusBranchId = CurrentEpochBranchId(chainActive.Height() + 1, Params().GetConsensus());
// We don't yet know if the transaction commits to consensusBranchId,
// but if the entry gets added to the mempool, then it has passed
// ContextualCheckInputs and therefore this is correct.
CTxMemPoolEntry entry(tx, nFees, GetTime(), dPriority, chainActive.Height(), mempool.HasNoInputsOf(tx), fSpendsCoinbase, consensusBranchId);
unsigned int nSize = entry.GetTxSize();