From ef8dfe41d1eba0de6d6554e25e658169f97313b5 Mon Sep 17 00:00:00 2001 From: Mark Friedenbach Date: Fri, 22 May 2015 14:49:50 -0700 Subject: Prevent block.nTime from decreasing Under some circumstances it is possible for there to be a significant, discontinuous jump in a node's clock value. On mining nodes, this can result in block templates which are no longer valid due to time-based nLockTime constraints. UpdateTime() is modified so that it will never decrease a block's nLockTime, thereby preventing such invalidations. --- src/miner.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/miner.h') diff --git a/src/miner.h b/src/miner.h index 96a6b70ecd..d46f4b1f2d 100644 --- a/src/miner.h +++ b/src/miner.h @@ -30,6 +30,6 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn); CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey); /** Modify the extranonce in a block */ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce); -void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev); +int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev); #endif // BITCOIN_MINER_H -- cgit v1.2.3