@@ -90,31 +90,28 @@ static const CRPCConvertParam vRPCConvertParams[] =
9090 { " prioritisetransaction" , 2 },
9191};
9292
93- class CRPCConvertTable
94- {
95- private:
96- std::set<std::pair<std::string, int > > members;
97-
98- public:
99- CRPCConvertTable ();
100-
101- bool convert (const std::string& method, int idx) {
102- return (members.count (std::make_pair (method, idx)) > 0 );
103- }
104- };
105-
10693CRPCConvertTable::CRPCConvertTable ()
10794{
10895 const unsigned int n_elem =
10996 (sizeof (vRPCConvertParams) / sizeof (vRPCConvertParams[0 ]));
11097
11198 for (unsigned int i = 0 ; i < n_elem; i++) {
112- members. insert ( std::make_pair (vRPCConvertParams[i].methodName ,
113- vRPCConvertParams[i].paramIdx ) );
99+ addConversion (vRPCConvertParams[i].methodName ,
100+ vRPCConvertParams[i].paramIdx );
114101 }
115102}
116103
117- static CRPCConvertTable rpcCvtTable;
104+ void CRPCConvertTable::addConversion (const std::string& method, int idx)
105+ {
106+ members.insert (std::make_pair (method, idx));
107+ }
108+
109+ bool CRPCConvertTable::convert (const std::string& method, int idx)
110+ {
111+ return (members.count (std::make_pair (method, idx)) > 0 );
112+ }
113+
114+ CRPCConvertTable rpcCvtTable;
118115
119116/* * Convert strings to command-specific RPC representation */
120117Array RPCConvertValues (const std::string &strMethod, const std::vector<std::string> &strParams)
0 commit comments