File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -261,13 +261,11 @@ CRPCTable::CRPCTable()
261261 }
262262}
263263
264- bool CRPCTable::appendCommand (const std::string& name, const CRPCCommand* pcmd)
264+ void CRPCTable::appendCommand (const std::string& name, const CRPCCommand* pcmd)
265265{
266- if (IsRPCRunning ())
267- return false ;
266+ CHECK_NONFATAL (!IsRPCRunning ()); // Only add commands before rpc is running
268267
269268 mapCommands[name].push_back (pcmd);
270- return true ;
271269}
272270
273271bool CRPCTable::removeCommand (const std::string& name, const CRPCCommand* pcmd)
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ class CRPCTable
160160 /* *
161161 * Appends a CRPCCommand to the dispatch table.
162162 *
163- * Returns false if RPC server is already running (dump concurrency protection).
163+ * Precondition: RPC server is not running
164164 *
165165 * Commands with different method names but the same unique_id will
166166 * be considered aliases, and only the first registered method name will
@@ -169,7 +169,7 @@ class CRPCTable
169169 * between calls based on method name, and aliased commands can also
170170 * register different names, types, and numbers of parameters.
171171 */
172- bool appendCommand (const std::string& name, const CRPCCommand* pcmd);
172+ void appendCommand (const std::string& name, const CRPCCommand* pcmd);
173173 bool removeCommand (const std::string& name, const CRPCCommand* pcmd);
174174};
175175
You can’t perform that action at this time.
0 commit comments