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

Function GetSporkValue

src/spork.cpp:99–114  ·  view source on GitHub ↗

grab the value of the spork on the network, or the default

Source from the content-addressed store, hash-verified

97
98// grab the value of the spork on the network, or the default
99long GetSporkValue(int nSporkID) {
100 int r = 0;
101 if (mapSporksActive.count(nSporkID)) {
102 r = mapSporksActive[nSporkID].nValue;
103 } else {
104 if (nSporkID == SPORK_1_MASTERNODE_PAYMENTS_ENFORCEMENT) r = SPORK_1_MASTERNODE_PAYMENTS_ENFORCEMENT_DEFAULT;
105 if (nSporkID == SPORK_2_MAX_VALUE) r = SPORK_2_MAX_VALUE_DEFAULT;
106 if (nSporkID == SPORK_3_REPLAY_BLOCKS) r = SPORK_3_REPLAY_BLOCKS_DEFAULT;
107 if (nSporkID == SPORK_5_REPLAY_BLOCKS) r = SPORK_5_REPLAY_BLOCKS_DEFAULT;
108 if (nSporkID == SPORK_6_RECONSIDER_BLOCKS) r = SPORK_6_RECONSIDER_BLOCKS_DEFAULT;
109 if (nSporkID == SPORK_7_INSTANTX) r = SPORK_7_INSTANTX_DEFAULT;
110 if (r == 0 && fDebug) LogPrintf("GetSpork::Unknown Spork %d\n", nSporkID);
111 }
112
113 return r;
114}
115
116void ExecuteSpork(int nSporkID, int nValue) {
117

Callers 2

IsIXTXValidFunction · 0.85
prepareTransactionMethod · 0.85

Calls 1

countMethod · 0.45

Tested by

no test coverage detected