aboutsummaryrefslogtreecommitdiff
path: root/src/node/miner.cpp
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2022-03-01 16:14:12 -0500
committerCarl Dong <contact@carldong.me>2022-05-20 11:57:51 -0400
commit04c31c1295eb4ecd42afd54b8e353cbda93d83f0 (patch)
tree1c5cd792c0dd52d0dc79cf21ba0623c12fdcfb83 /src/node/miner.cpp
parentdbe45c34f8b4fd7d615f7e05ef1454798ef0c8ca (diff)
downloadbitcoin-04c31c1295eb4ecd42afd54b8e353cbda93d83f0.tar.xz
Add ChainstateManager::m_adjusted_time_callback
This decouples validation.cpp from netaddress.cpp (transitively, timedata.cpp, and asmap.cpp). This is important for libbitcoinkernel as: - There is no reason for the consensus engine to be coupled with netaddress, timedata, and asmap - Users of libbitcoinkernel can now easily supply their own std::function that provides the adjusted time. See the src/Makefile.am changes for some satisfying removals.
Diffstat (limited to 'src/node/miner.cpp')
-rw-r--r--src/node/miner.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node/miner.cpp b/src/node/miner.cpp
index 48e50f3714..2464579dd1 100644
--- a/src/node/miner.cpp
+++ b/src/node/miner.cpp
@@ -167,7 +167,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
pblocktemplate->vTxSigOpsCost[0] = WITNESS_SCALE_FACTOR * GetLegacySigOpCount(*pblock->vtx[0]);
BlockValidationState state;
- if (!TestBlockValidity(state, chainparams, m_chainstate, *pblock, pindexPrev, false, false)) {
+ if (!TestBlockValidity(state, chainparams, m_chainstate, *pblock, pindexPrev, GetAdjustedTime, false, false)) {
throw std::runtime_error(strprintf("%s: TestBlockValidity failed: %s", __func__, state.ToString()));
}
int64_t nTime2 = GetTimeMicros();