Skip to content

Commit

Permalink
Cleanup StartRest()
Browse files Browse the repository at this point in the history
  • Loading branch information
DesWurstes committed Aug 11, 2018
1 parent f66e1c7 commit 2da54f5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/httprpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions src/rest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 2da54f5

Please sign in to comment.