MCPcopy Create free account
hub / github.com/Bitcoin-ABC/bitcoin-abc / IsReplayProtectionEnabled

Function IsReplayProtectionEnabled

src/validation.cpp:224–234  ·  view source on GitHub ↗

Command-line argument "-replayprotectionactivationtime= " will cause the node to switch to replay protected SigHash ForkID value when the median timestamp of the previous 11 blocks is greater than or equal to . Defaults to the pre-defined timestamp when not set.

Source from the content-addressed store, hash-verified

222// median timestamp of the previous 11 blocks is greater than or equal to
223// <timestamp>. Defaults to the pre-defined timestamp when not set.
224static bool
225IsReplayProtectionEnabled(const Consensus::Params &params,
226 const CBlockIndex *pindexPrev,
227 const std::optional<int64_t> activation_time) {
228 if (pindexPrev == nullptr) {
229 return false;
230 }
231
232 return pindexPrev->GetMedianTimePast() >=
233 activation_time.value_or(params.mengerActivationTime);
234}
235
236/**
237 * Checks to avoid mempool polluting consensus critical paths since cached

Callers 1

GetNextBlockScriptFlagsFunction · 0.85

Calls 2

GetMedianTimePastMethod · 0.80
value_orMethod · 0.80

Tested by

no test coverage detected