aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Todd <pete@petertodd.org>2015-11-13 16:36:54 -0500
committerPeter Todd <pete@petertodd.org>2015-11-13 16:36:54 -0500
commitc277a63ed70d063541e1e939917159129c102fec (patch)
treea530e4799639b35b9f2d576a7f206b1fbafb279d /src
parent748321eb5ba709feed716a3ccd0624a27767119f (diff)
downloadbitcoin-c277a63ed70d063541e1e939917159129c102fec.tar.xz
Clarify nLockTime-by-time comment in CheckFinalTx()
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 5208fbb031..baef017dc1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -670,10 +670,11 @@ bool CheckFinalTx(const CTransaction &tx, int flags)
// IsFinalTx() with one more than chainActive.Height().
const int nBlockHeight = chainActive.Height() + 1;
- // Timestamps on the other hand don't get any special treatment,
- // because we can't know what timestamp the next block will have,
- // and there aren't timestamp applications where it matters.
- // However this changes once median past time-locks are enforced:
+ // BIP113 will require that time-locked transactions have nLockTime set to
+ // less than the median time of the previous block they're contained in.
+ // When the next block is created its previous block will be the current
+ // chain tip, so we use that to calculate the median time passed to
+ // IsFinalTx() if LOCKTIME_MEDIAN_TIME_PAST is set.
const int64_t nBlockTime = (flags & LOCKTIME_MEDIAN_TIME_PAST)
? chainActive.Tip()->GetMedianTimePast()
: GetAdjustedTime();