Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 305 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
bool CheckSequenceLocks(const CTransaction &tx, int flags, LockPoints *lp, | bool CheckSequenceLocks(const CTransaction &tx, int flags, LockPoints *lp, | ||||
bool useExistingLockPoints) { | bool useExistingLockPoints) { | ||||
AssertLockHeld(cs_main); | AssertLockHeld(cs_main); | ||||
AssertLockHeld(g_mempool.cs); | AssertLockHeld(g_mempool.cs); | ||||
CBlockIndex *tip = chainActive.Tip(); | CBlockIndex *tip = chainActive.Tip(); | ||||
assert(tip != nullptr); | |||||
CBlockIndex index; | CBlockIndex index; | ||||
index.pprev = tip; | index.pprev = tip; | ||||
// CheckSequenceLocks() uses chainActive.Height()+1 to evaluate height based | // CheckSequenceLocks() uses chainActive.Height()+1 to evaluate height based | ||||
// locks because when SequenceLocks() is called within ConnectBlock(), the | // locks because when SequenceLocks() is called within ConnectBlock(), the | ||||
// height of the block *being* evaluated is what is used. Thus if we want to | // height of the block *being* evaluated is what is used. Thus if we want to | ||||
// know if a transaction can be part of the *next* block, we need to use one | // know if a transaction can be part of the *next* block, we need to use one | ||||
// more than chainActive.Height() | // more than chainActive.Height() | ||||
index.nHeight = tip->nHeight + 1; | index.nHeight = tip->nHeight + 1; | ||||
▲ Show 20 Lines • Show All 5,394 Lines • Show Last 20 Lines |