MCPcopy Create free account
hub / github.com/LUX-Core/lux / IsSporkActive

Function IsSporkActive

src/spork.cpp:79–96  ·  view source on GitHub ↗

grab the spork, otherwise say it's off

Source from the content-addressed store, hash-verified

77
78// grab the spork, otherwise say it's off
79bool IsSporkActive(int nSporkID) {
80 int64_t r = -1;
81
82 if (mapSporksActive.count(nSporkID)) {
83 r = mapSporksActive[nSporkID].nValue;
84 } else {
85 if (nSporkID == SPORK_1_MASTERNODE_PAYMENTS_ENFORCEMENT) r = SPORK_1_MASTERNODE_PAYMENTS_ENFORCEMENT_DEFAULT;
86 if (nSporkID == SPORK_2_MAX_VALUE) r = SPORK_2_MAX_VALUE_DEFAULT;
87 if (nSporkID == SPORK_3_REPLAY_BLOCKS) r = SPORK_3_REPLAY_BLOCKS_DEFAULT;
88 if (nSporkID == SPORK_5_REPLAY_BLOCKS) r = SPORK_5_REPLAY_BLOCKS_DEFAULT;
89 if (nSporkID == SPORK_6_RECONSIDER_BLOCKS) r = SPORK_6_RECONSIDER_BLOCKS_DEFAULT;
90 if (nSporkID == SPORK_7_INSTANTX) r = SPORK_7_INSTANTX_DEFAULT;
91 if (r == -1 && fDebug) LogPrintf("GetSpork::Unknown Spork %d\n", nSporkID);
92 }
93 if (r == -1) r = 4070908800; //return 2099-1-1 by default
94
95 return r < GetTime();
96}
97
98// grab the value of the spork on the network, or the default
99long GetSporkValue(int nSporkID) {

Callers 2

ProcessInstantXFunction · 0.85

Calls 2

GetTimeFunction · 0.85
countMethod · 0.45

Tested by

no test coverage detected