318 | @@ -319,3 +319,8 @@ void StopHTTPRPC()
319 | httpRPCTimerInterface.reset();
320 | }
321 | }
322 | +
323 | +const std::set<std::string>& GetWhitelistedRpcs(const std::string& user_name)
324 | +{
325 | + return g_rpc_whitelist.at(user_name);
This fails when user is not in the map.
Not clear what it should do for users that don't have a whitelist (ie, can access all methods). Currently errors I think.
I believe it should return the list of all available RPC methods. It's consistent and it'd enable feature detection. See #19087 for more discussion about feature detection.
If the rpc whitelist is empty, one could call help to get all methods. But maybe just returning the whole set here seems appropriate. How to deal with hidden RPCs, though?
I think it should return empty - no whitelist is defined for the user.
Hmm, should it be designed for simplicity of bitcoind or practicality of clients? I suppose this feature will be most useful for auto-detecting available features, but maybe I'm missing something?
I guess that makes sense, but I think hidden methods should not be included by default.
Do I understand correctly that the hidden methods are used for testing only?