core_rpc_server: add a --restricted-rpc option

It does not expose the RPC for commands like start_mining, etc
(ie, commands a public node operator might want to be restricted)
This commit is contained in:
moneromooo-monero 2015-11-27 18:24:29 +00:00
parent 4061a32082
commit 75742977a8
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
3 changed files with 26 additions and 14 deletions

View file

@ -55,8 +55,8 @@
#define MAP_URI_AUTO_XML2(s_pattern, callback_f, command_type) //TODO: don't think i ever again will use xml - ambiguous and "overtagged" format
#define MAP_URI_AUTO_JON2(s_pattern, callback_f, command_type) \
else if(query_info.m_URI == s_pattern) \
#define MAP_URI_AUTO_JON2_IF(s_pattern, callback_f, command_type, cond) \
else if((query_info.m_URI == s_pattern) && (cond)) \
{ \
handled = true; \
uint64_t ticks = misc_utils::get_tick_count(); \
@ -80,6 +80,8 @@
LOG_PRINT( s_pattern << " processed with " << ticks1-ticks << "/"<< ticks2-ticks1 << "/" << ticks3-ticks2 << "ms", LOG_LEVEL_2); \
}
#define MAP_URI_AUTO_JON2(s_pattern, callback_f, command_type) MAP_URI_AUTO_JON2_IF(s_pattern, callback_f, command_type, true)
#define MAP_URI_AUTO_BIN2(s_pattern, callback_f, command_type) \
else if(query_info.m_URI == s_pattern) \
{ \