Merge #13938: refactoring: Cleanup StartRest()

2da54f5a66 Cleanup StartRest() (DesWurstes)

Pull request description:

Tree-SHA512: 7e907315009c0351b7a3347ec13b6727abd12fe722d51cc061cb635ea20f9a550af5f50dc364c4313501b0dfc3696bcfa26a2a5f0170a4b5808624e043085d29
This commit is contained in:
MarcoFalke 2018-08-13 09:42:48 -04:00
commit f083ec13c3
No known key found for this signature in database
GPG key ID: D2EA4850E7528B25
3 changed files with 3 additions and 5 deletions

View file

@ -23,7 +23,7 @@ void StopHTTPRPC();
/** Start HTTP REST subsystem.
* Precondition; HTTP and RPC has been started.
*/
bool StartREST();
void StartREST();
/** Interrupt RPC REST subsystem.
*/
void InterruptREST();

View file

@ -736,8 +736,7 @@ static bool AppInitServers()
StartRPC();
if (!StartHTTPRPC())
return false;
if (gArgs.GetBoolArg("-rest", DEFAULT_REST_ENABLE) && !StartREST())
return false;
if (gArgs.GetBoolArg("-rest", DEFAULT_REST_ENABLE)) StartREST();
StartHTTPServer();
return true;
}

View file

@ -591,11 +591,10 @@ static const struct {
{"/rest/getutxos", rest_getutxos},
};
bool StartREST()
void StartREST()
{
for (unsigned int i = 0; i < ARRAYLEN(uri_prefixes); i++)
RegisterHTTPHandler(uri_prefixes[i].prefix, false, uri_prefixes[i].handler);
return true;
}
void InterruptREST()