Skip to content

Commit fa93bc1

Browse files
author
MarcoFalke
committed
rpc: Remove unused return type from appendCommand
1 parent 4d4bd5e commit fa93bc1

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/rpc/server.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff 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

273271
bool CRPCTable::removeCommand(const std::string& name, const CRPCCommand* pcmd)

src/rpc/server.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)