@@ -112,71 +112,6 @@ static RPCHelpMan masternode_count()
112112 };
113113}
114114
115- static UniValue GetNextMasternodeForPayment (const CChain& active_chain, CDeterministicMNManager& dmnman, int heightShift)
116- {
117- const CBlockIndex *tip = WITH_LOCK (::cs_main, return active_chain.Tip ());
118- auto mnList = dmnman.GetListForBlock (tip);
119- auto payees = mnList.GetProjectedMNPayees (tip, heightShift);
120- if (payees.empty ())
121- return " unknown" ;
122- auto payee = payees.back ();
123- CScript payeeScript = payee->pdmnState ->scriptPayout ;
124-
125- CTxDestination payeeDest;
126- ExtractDestination (payeeScript, payeeDest);
127-
128- UniValue obj (UniValue::VOBJ);
129-
130- obj.pushKV (" height" , mnList.GetHeight () + heightShift);
131- obj.pushKV (" IP:port" , payee->pdmnState ->addr .ToStringAddrPort ());
132- obj.pushKV (" proTxHash" , payee->proTxHash .ToString ());
133- obj.pushKV (" outpoint" , payee->collateralOutpoint .ToStringShort ());
134- obj.pushKV (" payee" , IsValidDestination (payeeDest) ? EncodeDestination (payeeDest) : " UNKNOWN" );
135- return obj;
136- }
137-
138- // TODO: drop it
139- static RPCHelpMan masternode_winner ()
140- {
141- return RPCHelpMan{" masternode winner" ,
142- " Print info on next masternode winner to vote for\n " ,
143- {},
144- RPCResults{},
145- RPCExamples{" " },
146- [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
147- {
148- if (!IsDeprecatedRPCEnabled (" masternode_winner" )) {
149- throw std::runtime_error (" DEPRECATED: set -deprecatedrpc=masternode_winner to enable it" );
150- }
151-
152- const NodeContext& node = EnsureAnyNodeContext (request.context );
153- const ChainstateManager& chainman = EnsureChainman (node);
154- return GetNextMasternodeForPayment (chainman.ActiveChain (), *CHECK_NONFATAL (node.dmnman ), 10 );
155- },
156- };
157- }
158-
159- // TODO: drop it
160- static RPCHelpMan masternode_current ()
161- {
162- return RPCHelpMan{" masternode current" ,
163- " Print info on current masternode winner to be paid the next block (calculated locally)\n " ,
164- {},
165- RPCResults{},
166- RPCExamples{" " },
167- [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
168- {
169- if (!IsDeprecatedRPCEnabled (" masternode_current" )) {
170- throw std::runtime_error (" DEPRECATED: set -deprecatedrpc=masternode_current to enable it" );
171- }
172-
173- const NodeContext& node = EnsureAnyNodeContext (request.context );
174- const ChainstateManager& chainman = EnsureChainman (node);
175- return GetNextMasternodeForPayment (chainman.ActiveChain (), *CHECK_NONFATAL (node.dmnman ), 1 );
176- },
177- };
178- }
179-
180115#ifdef ENABLE_WALLET
181116static RPCHelpMan masternode_outputs ()
182117{
@@ -753,8 +688,6 @@ static const CRPCCommand commands[] =
753688 { " dash" , &masternode_status, },
754689 { " dash" , &masternode_payments, },
755690 { " dash" , &masternode_winners, },
756- { " hidden" , &masternode_current, },
757- { " hidden" , &masternode_winner, },
758691};
759692// clang-format on
760693 for (const auto & command : commands) {
0 commit comments