aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
authorMark Friedenbach <mark@friedenbach.org>2015-06-03 12:55:45 -0700
committerMark Friedenbach <mark@friedenbach.org>2015-10-23 09:02:24 -0700
commit9d55050773d57c0e12005e524f2e54d9e622c6e2 (patch)
tree5e07889ff64f153d39b0a4b06d5e2ac29621153f /src/main.h
parent46f74379b86be982b121bcb8c3cfe07fa80bffd0 (diff)
Add rules--presently disabled--for using GetMedianTimePast as endpoint for lock-time calculations
The lock-time code currently uses CBlock::nTime as the cutoff point for time based locked transactions. This has the unfortunate outcome of creating a perverse incentive for miners to lie about the time of a block in order to collect more fees by including transactions that by wall clock determination have not yet matured. By using CBlockIndex::GetMedianTimePast from the prior block instead, the self-interested miner no longer gains from generating blocks with fraudulent timestamps. Users can compensate for this change by simply adding an hour (3600 seconds) to their time-based lock times. If enforced, this would be a soft-fork change. This commit only adds the functionality on an unexecuted code path, without changing the behaviour of Bitcoin Core.
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.h b/src/main.h
index 202d2c772b..65732d770f 100644
--- a/src/main.h
+++ b/src/main.h
@@ -308,8 +308,10 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime);
* Check if transaction will be final in the next block to be created.
*
* Calls IsFinalTx() with current block height and appropriate block time.
+ *
+ * See consensus/consensus.h for flag definitions.
*/
-bool CheckFinalTx(const CTransaction &tx);
+bool CheckFinalTx(const CTransaction &tx, int flags = -1);
/**
* Closure representing one script verification