Skip to content

Commit c277a63

Browse files
committed
Clarify nLockTime-by-time comment in CheckFinalTx()
1 parent 748321e commit c277a63

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -670,10 +670,11 @@ bool CheckFinalTx(const CTransaction &tx, int flags)
670670
// IsFinalTx() with one more than chainActive.Height().
671671
const int nBlockHeight = chainActive.Height() + 1;
672672

673-
// Timestamps on the other hand don't get any special treatment,
674-
// because we can't know what timestamp the next block will have,
675-
// and there aren't timestamp applications where it matters.
676-
// However this changes once median past time-locks are enforced:
673+
// BIP113 will require that time-locked transactions have nLockTime set to
674+
// less than the median time of the previous block they're contained in.
675+
// When the next block is created its previous block will be the current
676+
// chain tip, so we use that to calculate the median time passed to
677+
// IsFinalTx() if LOCKTIME_MEDIAN_TIME_PAST is set.
677678
const int64_t nBlockTime = (flags & LOCKTIME_MEDIAN_TIME_PAST)
678679
? chainActive.Tip()->GetMedianTimePast()
679680
: GetAdjustedTime();

0 commit comments

Comments
 (0)