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()
261
261
}
262
262
}
263
263
264
- bool CRPCTable::appendCommand (const std::string& name, const CRPCCommand* pcmd)
264
+ void CRPCTable::appendCommand (const std::string& name, const CRPCCommand* pcmd)
265
265
{
266
- if (IsRPCRunning ())
267
- return false ;
266
+ CHECK_NONFATAL (!IsRPCRunning ()); // Only add commands before rpc is running
268
267
269
268
mapCommands[name].push_back (pcmd);
270
- return true ;
271
269
}
272
270
273
271
bool 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
160
160
/* *
161
161
* Appends a CRPCCommand to the dispatch table.
162
162
*
163
- * Returns false if RPC server is already running (dump concurrency protection).
163
+ * Precondition: RPC server is not running
164
164
*
165
165
* Commands with different method names but the same unique_id will
166
166
* be considered aliases, and only the first registered method name will
@@ -169,7 +169,7 @@ class CRPCTable
169
169
* between calls based on method name, and aliased commands can also
170
170
* register different names, types, and numbers of parameters.
171
171
*/
172
- bool appendCommand (const std::string& name, const CRPCCommand* pcmd);
172
+ void appendCommand (const std::string& name, const CRPCCommand* pcmd);
173
173
bool removeCommand (const std::string& name, const CRPCCommand* pcmd);
174
174
};
175
175
You can’t perform that action at this time.
0 commit comments