| 252 | } |
| 253 | |
| 254 | bool CheckSequenceLocksAtTip(CBlockIndex* tip, |
| 255 | const LockPoints& lock_points) |
| 256 | { |
| 257 | assert(tip != nullptr); |
| 258 | |
| 259 | CBlockIndex index; |
| 260 | index.pprev = tip; |
| 261 | // CheckSequenceLocksAtTip() uses active_chainstate.m_chain.Height()+1 to evaluate |
| 262 | // height based locks because when SequenceLocks() is called within |
| 263 | // ConnectBlock(), the height of the block *being* |
| 264 | // evaluated is what is used. |
| 265 | // Thus if we want to know if a transaction can be part of the |
| 266 | // *next* block, we need to use one more than active_chainstate.m_chain.Height() |
| 267 | index.nHeight = tip->nHeight + 1; |
| 268 | |
| 269 | return EvaluateSequenceLocks(index, {lock_points.height, lock_points.time}); |
| 270 | } |
| 271 | |
| 272 | static void LimitMempoolSize(CTxMemPool& pool, CCoinsViewCache& coins_cache) |
| 273 | EXCLUSIVE_LOCKS_REQUIRED(::cs_main, pool.cs) |