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