Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 410 Lines • ▼ Show 20 Lines | if (useExistingLockPoints) { | ||||
// except in the special case where the relative lock time/height is | // except in the special case where the relative lock time/height is | ||||
// 0, which is equivalent to no sequence lock. Since we assume input | // 0, which is equivalent to no sequence lock. Since we assume input | ||||
// height of tip+1 for mempool txs and test the resulting lockPair | // height of tip+1 for mempool txs and test the resulting lockPair | ||||
// from CalculateSequenceLocks against tip+1. We know | // from CalculateSequenceLocks against tip+1. We know | ||||
// EvaluateSequenceLocks will fail if there was a non-zero sequence | // EvaluateSequenceLocks will fail if there was a non-zero sequence | ||||
// lock on a mempool input, so we can use the return value of | // lock on a mempool input, so we can use the return value of | ||||
// CheckSequenceLocks to indicate the LockPoints validity. | // CheckSequenceLocks to indicate the LockPoints validity. | ||||
int maxInputHeight = 0; | int maxInputHeight = 0; | ||||
for (int height : prevheights) { | for (const int height : prevheights) { | ||||
// Can ignore mempool inputs since we'll fail if they had | // Can ignore mempool inputs since we'll fail if they had | ||||
// non-zero locks. | // non-zero locks. | ||||
if (height != tip->nHeight + 1) { | if (height != tip->nHeight + 1) { | ||||
maxInputHeight = std::max(maxInputHeight, height); | maxInputHeight = std::max(maxInputHeight, height); | ||||
} | } | ||||
} | } | ||||
lp->maxInputBlock = tip->GetAncestor(maxInputHeight); | lp->maxInputBlock = tip->GetAncestor(maxInputHeight); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 5,333 Lines • Show Last 20 Lines |