Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.cpp
Show First 20 Lines • Show All 1,365 Lines • ▼ Show 20 Lines | void DisconnectedBlockTransactions::updateMempoolForReorg(const Config &config, | ||||
// AcceptToMemoryPool/addUnchecked all assume that new mempool entries have | // AcceptToMemoryPool/addUnchecked all assume that new mempool entries have | ||||
// no in-mempool children, which is generally not true when adding | // no in-mempool children, which is generally not true when adding | ||||
// previously-confirmed transactions back to the mempool. | // previously-confirmed transactions back to the mempool. | ||||
// UpdateTransactionsFromBlock finds descendants of any transactions in the | // UpdateTransactionsFromBlock finds descendants of any transactions in the | ||||
// disconnectpool that were added back and cleans up the mempool state. | // disconnectpool that were added back and cleans up the mempool state. | ||||
mempool.UpdateTransactionsFromBlock(txidsUpdate); | mempool.UpdateTransactionsFromBlock(txidsUpdate); | ||||
// We also need to remove any now-immature transactions | // We also need to remove any now-immature transactions | ||||
mempool.removeForReorg(config, pcoinsTip, chainActive.Tip()->nHeight + 1, | mempool.removeForReorg(config, pcoinsTip.get(), | ||||
chainActive.Tip()->nHeight + 1, | |||||
STANDARD_LOCKTIME_VERIFY_FLAGS); | STANDARD_LOCKTIME_VERIFY_FLAGS); | ||||
// Re-limit mempool size, in case we added any transactions | // Re-limit mempool size, in case we added any transactions | ||||
mempool.LimitSize( | mempool.LimitSize( | ||||
gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, | gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, | ||||
gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60); | gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60); | ||||
} | } |