mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
fix(rpc): display proper governance fee in getgovernanceinfo
(#4778)
This commit is contained in:
parent
712f60dd21
commit
9b8c2dc7c6
@ -1174,13 +1174,15 @@ static UniValue getgovernanceinfo(const JSONRPCRequest& request)
|
||||
}
|
||||
|
||||
int nLastSuperblock = 0, nNextSuperblock = 0;
|
||||
int nBlockHeight = WITH_LOCK(cs_main, return ::ChainActive().Height());
|
||||
const auto* pindex = WITH_LOCK(cs_main, return ::ChainActive().Tip());
|
||||
int nBlockHeight = pindex->nHeight;
|
||||
|
||||
CSuperblock::GetNearestSuperblocksHeights(nBlockHeight, nLastSuperblock, nNextSuperblock);
|
||||
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
obj.pushKV("governanceminquorum", Params().GetConsensus().nGovernanceMinQuorum);
|
||||
obj.pushKV("proposalfee", ValueFromAmount(GOVERNANCE_PROPOSAL_FEE_TX));
|
||||
bool fork_active = VersionBitsState(pindex, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0024, versionbitscache) == ThresholdState::ACTIVE;
|
||||
obj.pushKV("proposalfee", ValueFromAmount(fork_active ? GOVERNANCE_PROPOSAL_FEE_TX : GOVERNANCE_PROPOSAL_FEE_TX_OLD));
|
||||
obj.pushKV("superblockcycle", Params().GetConsensus().nSuperblockCycle);
|
||||
obj.pushKV("lastsuperblock", nLastSuperblock);
|
||||
obj.pushKV("nextsuperblock", nNextSuperblock);
|
||||
|
Loading…
Reference in New Issue
Block a user