@ -10,8 +10,10 @@
# include <chain.h>
# include <chain.h>
# include <chainparams.h>
# include <chainparams.h>
# include <coins.h>
# include <coins.h>
# include <consensus/params.h>
# include <consensus/validation.h>
# include <consensus/validation.h>
# include <core_io.h>
# include <core_io.h>
# include <deploymentinfo.h>
# include <deploymentstatus.h>
# include <deploymentstatus.h>
# include <hash.h>
# include <hash.h>
# include <index/blockfilterindex.h>
# include <index/blockfilterindex.h>
@ -38,6 +40,7 @@
# include <util/translation.h>
# include <util/translation.h>
# include <validation.h>
# include <validation.h>
# include <validationinterface.h>
# include <validationinterface.h>
# include <versionbits.h>
# include <warnings.h>
# include <warnings.h>
# include <stdint.h>
# include <stdint.h>
@ -1344,25 +1347,25 @@ static RPCHelpMan verifychain()
} ;
} ;
}
}
static void BuriedForkDescPushBack( UniValue & softforks , const std : : string & name , int softfork_height , int tip_height ) EXCLUSIVE_LOCKS_REQUIRED ( cs_main )
static void SoftForkDescPushBack( const CBlockIndex * active_chain_tip , UniValue & softforks , const Consensus : : Params & params , Consensus : : BuriedDeployment dep )
{
{
// For buried deployments.
// For buried deployments.
// A buried deployment is one where the height of the activation has been hardcoded into
// A buried deployment is one where the height of the activation has been hardcoded into
// the client implementation long after the consensus change has activated. See BIP 90.
// the client implementation long after the consensus change has activated. See BIP 90.
// Buried deployments with activation height value of
// Buried deployments with activation height value of
// std::numeric_limits<int>::max() are disabled and thus hidden.
// std::numeric_limits<int>::max() are disabled and thus hidden.
if ( softfork_height = = std : : numeric_limits < int > : : max ( ) ) return ;
if ( ! DeploymentEnabled ( params , dep ) ) return ;
UniValue rv ( UniValue : : VOBJ ) ;
UniValue rv ( UniValue : : VOBJ ) ;
rv . pushKV ( " type " , " buried " ) ;
rv . pushKV ( " type " , " buried " ) ;
// getblockchaininfo reports the softfork as active from when the chain height is
// getblockchaininfo reports the softfork as active from when the chain height is
// one below the activation height
// one below the activation height
rv . pushKV ( " active " , tip_height + 1 > = softfork_height ) ;
rv . pushKV ( " active " , DeploymentActiveAfter( active_chain_tip , params , dep ) ) ;
rv . pushKV ( " height " , softfork_height ) ;
rv . pushKV ( " height " , params. DeploymentHeight ( dep ) ) ;
softforks . pushKV ( name, rv ) ;
softforks . pushKV ( Deployme ntN ame( dep ) , rv ) ;
}
}
static void BIP9 SoftForkDescPushBack( const CBlockIndex * active_chain_tip , UniValue & softforks , const std : : string & name , const Consensus : : Params & consensusParams , Consensus : : DeploymentPos id )
static void SoftForkDescPushBack( const CBlockIndex * active_chain_tip , UniValue & softforks , const Consensus : : Params & consensusParams , Consensus : : DeploymentPos id )
{
{
// For BIP9 deployments.
// For BIP9 deployments.
// Deployments that are never active are hidden.
// Deployments that are never active are hidden.
@ -1406,7 +1409,7 @@ static void BIP9SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniVal
}
}
rv . pushKV ( " active " , ThresholdState : : ACTIVE = = thresholdState ) ;
rv . pushKV ( " active " , ThresholdState : : ACTIVE = = thresholdState ) ;
softforks . pushKV ( name, rv ) ;
softforks . pushKV ( Deployme ntN ame( id ) , rv ) ;
}
}
RPCHelpMan getblockchaininfo ( )
RPCHelpMan getblockchaininfo ( )
@ -1503,14 +1506,14 @@ RPCHelpMan getblockchaininfo()
const Consensus : : Params & consensusParams = Params ( ) . GetConsensus ( ) ;
const Consensus : : Params & consensusParams = Params ( ) . GetConsensus ( ) ;
UniValue softforks ( UniValue : : VOBJ ) ;
UniValue softforks ( UniValue : : VOBJ ) ;
BuriedForkDescPushBack( softforks , " bip34 " , consensusParams . BIP34Height , height ) ;
SoftForkDescPushBack( tip , softforks , consensusParams , Consensus : : DEPLOYMENT_HEIGHTINCB ) ;
BuriedForkDescPushBack( softforks , " bip66 " , consensusParams . BIP66Height , height ) ;
SoftForkDescPushBack( tip , softforks , consensusParams , Consensus : : DEPLOYMENT_DERSIG ) ;
BuriedForkDescPushBack( softforks , " bip65 " , consensusParams . BIP65Height , height ) ;
SoftForkDescPushBack( tip , softforks , consensusParams , Consensus : : DEPLOYMENT_CLTV ) ;
BuriedForkDescPushBack( softforks , " csv " , consensusParams . CSVHeight , height ) ;
SoftForkDescPushBack( tip , softforks , consensusParams , Consensus : : DEPLOYMENT_CSV ) ;
BuriedForkDescPushBack( softforks , " segwit " , consensusParams . SegwitHeight , height ) ;
SoftForkDescPushBack( tip , softforks , consensusParams , Consensus : : DEPLOYMENT_SEGWIT ) ;
BIP9 SoftForkDescPushBack( tip , softforks , " testdummy " , consensusParams , Consensus : : DEPLOYMENT_TESTDUMMY ) ;
SoftForkDescPushBack( tip , softforks , consensusParams , Consensus : : DEPLOYMENT_TESTDUMMY ) ;
BIP9 SoftForkDescPushBack( tip , softforks , " taproot " , consensusParams , Consensus : : DEPLOYMENT_TAPROOT ) ;
SoftForkDescPushBack( tip , softforks , consensusParams , Consensus : : DEPLOYMENT_TAPROOT ) ;
obj . pushKV ( " softforks " , softforks ) ;
obj . pushKV ( " softforks " , softforks ) ;
obj . pushKV ( " warnings " , GetWarnings ( false ) . original ) ;
obj . pushKV ( " warnings " , GetWarnings ( false ) . original ) ;
return obj ;
return obj ;