File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -285,24 +285,21 @@ class GOVImpl : public GOV
285285 GovernanceInfo getGovernanceInfo () override
286286 {
287287 GovernanceInfo info;
288- const NodeContext& ctx = context ();
289288 const Consensus::Params& consensusParams = Params ().GetConsensus ();
290-
291- if (ctx.chainman ) {
292- CSuperblock::GetNearestSuperblocksHeights (ctx.chainman ->ActiveHeight (), info.lastsuperblock , info.nextsuperblock );
289+ if (context ().chainman ) {
290+ LOCK (::cs_main);
291+ CSuperblock::GetNearestSuperblocksHeights (context ().chainman ->ActiveHeight (), info.lastsuperblock , info.nextsuperblock );
292+ info.governancebudget = CSuperblock::GetPaymentsLimit (context ().chainman ->ActiveChain (), info.nextsuperblock );
293+ if (context ().dmnman ) {
294+ info.fundingthreshold = context ().dmnman ->GetListAtChainTip ().GetValidWeightedMNsCount () / 10 ;
295+ }
293296 }
294297 info.proposalfee = GOVERNANCE_PROPOSAL_FEE_TX;
295298 info.superblockcycle = consensusParams.nSuperblockCycle ;
296299 info.superblockmaturitywindow = consensusParams.nSuperblockMaturityWindow ;
297300 info.targetSpacing = consensusParams.nPowTargetSpacing ;
298301 info.relayRequiredConfs = GOVERNANCE_MIN_RELAY_FEE_CONFIRMATIONS;
299302 info.requiredConfs = GOVERNANCE_FEE_CONFIRMATIONS;
300- if (ctx.dmnman ) {
301- info.fundingthreshold = ctx.dmnman ->GetListAtChainTip ().GetValidWeightedMNsCount () / 10 ;
302- }
303- if (ctx.chainman ) {
304- info.governancebudget = CSuperblock::GetPaymentsLimit (ctx.chainman ->ActiveChain (), info.nextsuperblock );
305- }
306303 return info;
307304 }
308305 std::optional<int32_t > getProposalFundedHeight (const uint256& proposal_hash) override
You can’t perform that action at this time.
0 commit comments