@@ -868,6 +868,15 @@ static UniValue BIP9SoftForkDesc(const Consensus::Params& consensusParams, Conse
868
868
return rv;
869
869
}
870
870
871
+ void BIP9SoftForkDescPushBack (UniValue& bip9_softforks, const std::string &name, const Consensus::Params& consensusParams, Consensus::DeploymentPos id)
872
+ {
873
+ // Deployments with timeout value of 0 are hidden.
874
+ // A timeout value of 0 guarantees a softfork will never be activated.
875
+ // This is used when softfork codes are merged without specifying the deployment schedule.
876
+ if (consensusParams.vDeployments [id].nTimeout > 0 )
877
+ bip9_softforks.push_back (Pair (name, BIP9SoftForkDesc (consensusParams, id)));
878
+ }
879
+
871
880
UniValue getblockchaininfo (const UniValue& params, bool fHelp )
872
881
{
873
882
if (fHelp || params.size () != 0 )
@@ -901,7 +910,7 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp)
901
910
" ],\n "
902
911
" \" bip9_softforks\" : { (object) status of BIP9 softforks in progress\n "
903
912
" \" xxxx\" : { (string) name of the softfork\n "
904
- " \" status\" : \" xxxx\" , (string) one of \" defined\" , \" started\" , \" lockedin \" , \" active\" , \" failed\"\n "
913
+ " \" status\" : \" xxxx\" , (string) one of \" defined\" , \" started\" , \" locked_in \" , \" active\" , \" failed\"\n "
905
914
" \" bit\" : xx, (numeric) the bit, 0-28, in the block version field used to signal this soft fork\n "
906
915
" \" startTime\" : xx, (numeric) the minimum median time past of a block at which the bit gains its meaning\n "
907
916
" \" timeout\" : xx (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in\n "
@@ -933,8 +942,8 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp)
933
942
softforks.push_back (SoftForkDesc (" bip34" , 2 , tip, consensusParams));
934
943
softforks.push_back (SoftForkDesc (" bip66" , 3 , tip, consensusParams));
935
944
softforks.push_back (SoftForkDesc (" bip65" , 4 , tip, consensusParams));
936
- bip9_softforks. push_back ( Pair ( " csv" , BIP9SoftForkDesc ( consensusParams, Consensus::DEPLOYMENT_CSV)) );
937
- bip9_softforks. push_back ( Pair ( " segwit" , BIP9SoftForkDesc ( consensusParams, Consensus::DEPLOYMENT_SEGWIT)) );
945
+ BIP9SoftForkDescPushBack (bip9_softforks, " csv" , consensusParams, Consensus::DEPLOYMENT_CSV);
946
+ BIP9SoftForkDescPushBack (bip9_softforks, " segwit" , consensusParams, Consensus::DEPLOYMENT_SEGWIT);
938
947
obj.push_back (Pair (" softforks" , softforks));
939
948
obj.push_back (Pair (" bip9_softforks" , bip9_softforks));
940
949
0 commit comments