Add proof-of-stake check in BlockAssembler::addPriorityTxs()
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user