diff --git a/src/miner.cpp b/src/miner.cpp index 887c49a6a..6ff8894fc 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -147,7 +147,7 @@ CBlockTemplate* BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn, in nLockTimeCutoff = pblock->GetBlockTime(); - addPriorityTxs(); + addPriorityTxs(pblock->GetBlockTime(), fProofOfStake); addPackageTxs(); nLastBlockTx = nBlockTx; @@ -480,7 +480,7 @@ void BlockAssembler::addPackageTxs() } } -void BlockAssembler::addPriorityTxs() +void BlockAssembler::addPriorityTxs(int64_t nBlockTime, bool fProofOfStake) { // How much of the block should be dedicated to high-priority transactions, // included regardless of the fees they pay @@ -522,6 +522,9 @@ void BlockAssembler::addPriorityTxs() continue; } + if (fProofOfStake && nBlockTime < (int64_t)iter->GetTx().nTime) + continue; + // If tx is dependent on other mempool txs which haven't yet been included // then put it in the waitSet if (isStillDependent(iter)) { diff --git a/src/miner.h b/src/miner.h index a59092bad..f3951e4d5 100644 --- a/src/miner.h +++ b/src/miner.h @@ -172,7 +172,7 @@ private: // Methods for how to add transactions to a block. /** Add transactions based on tx "priority" */ - void addPriorityTxs(); + void addPriorityTxs(int64_t nBlockTime, bool fProofOfStake); /** Add transactions based on feerate including unconfirmed ancestors */ void addPackageTxs();