MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / BIP9SoftForkDesc

Function BIP9SoftForkDesc

src/rpc/blockchain.cpp:1193–1223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1191}
1192
1193static UniValue BIP9SoftForkDesc(const Consensus::Params& consensusParams, Consensus::DeploymentPos id)
1194{
1195 UniValue rv(UniValue::VOBJ);
1196 const ThresholdState thresholdState = VersionBitsTipState(consensusParams, id);
1197 switch (thresholdState) {
1198 case ThresholdState::DEFINED: rv.pushKV("status", "defined"); break;
1199 case ThresholdState::STARTED: rv.pushKV("status", "started"); break;
1200 case ThresholdState::LOCKED_IN: rv.pushKV("status", "locked_in"); break;
1201 case ThresholdState::ACTIVE: rv.pushKV("status", "active"); break;
1202 case ThresholdState::FAILED: rv.pushKV("status", "failed"); break;
1203 }
1204 if (ThresholdState::STARTED == thresholdState)
1205 {
1206 rv.pushKV("bit", consensusParams.vDeployments[id].bit);
1207 }
1208 rv.pushKV("startTime", consensusParams.vDeployments[id].nStartTime);
1209 rv.pushKV("timeout", consensusParams.vDeployments[id].nTimeout);
1210 rv.pushKV("since", VersionBitsTipStateSinceHeight(consensusParams, id));
1211 if (ThresholdState::STARTED == thresholdState)
1212 {
1213 UniValue statsUV(UniValue::VOBJ);
1214 BIP9Stats statsStruct = VersionBitsTipStatistics(consensusParams, id);
1215 statsUV.pushKV("period", statsStruct.period);
1216 statsUV.pushKV("threshold", statsStruct.threshold);
1217 statsUV.pushKV("elapsed", statsStruct.elapsed);
1218 statsUV.pushKV("count", statsStruct.count);
1219 statsUV.pushKV("possible", statsStruct.possible);
1220 rv.pushKV("statistics", statsUV);
1221 }
1222 return rv;
1223}
1224
1225static void BIP9SoftForkDescPushBack(UniValue& bip9_softforks, const Consensus::Params& consensusParams, Consensus::DeploymentPos id)
1226{

Callers 1

BIP9SoftForkDescPushBackFunction · 0.85

Calls 4

VersionBitsTipStateFunction · 0.85
VersionBitsTipStatisticsFunction · 0.85
pushKVMethod · 0.45

Tested by

no test coverage detected