Add proof-of-stake check in BlockAssembler::addPriorityTxs()

This commit is contained in:
lateminer
2018-11-02 00:48:18 +03:00
parent 3439588591
commit a329674df6
2 changed files with 6 additions and 3 deletions

View File

@@ -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)) {

View File

@@ -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();