fixup CreateNewBlock required age of transactions

This commit is contained in:
Gregory Sanders 2018-11-14 12:02:40 -05:00
parent 3902a2902b
commit 8f287d4100

View file

@ -98,6 +98,7 @@ void BlockAssembler::resetBlock()
std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn, bool fMineWitnessTx, int required_age_in_secs)
{
assert(required_age_in_secs >= 0);
int64_t nTimeStart = GetTimeMicros();
resetBlock();
@ -368,7 +369,8 @@ void BlockAssembler::addPackageTxs(int &nPackagesSelected, int &nDescendantsUpda
}
// Skip transactions that are under X seconds in mempool
if (iter->GetTime() > GetTime() - required_age_in_secs) {
// required_age_in_secs value of 0 is considered "inactive", in case of mocktime
if (required_age_in_secs > 0 && iter->GetTime() > GetTime() - required_age_in_secs) {
continue;
}