mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-12 04:42:36 -03:00
Cleanup StartRest()
This commit is contained in:
parent
f66e1c793e
commit
2da54f5a66
3 changed files with 3 additions and 5 deletions
|
@ -23,7 +23,7 @@ void StopHTTPRPC();
|
||||||
/** Start HTTP REST subsystem.
|
/** Start HTTP REST subsystem.
|
||||||
* Precondition; HTTP and RPC has been started.
|
* Precondition; HTTP and RPC has been started.
|
||||||
*/
|
*/
|
||||||
bool StartREST();
|
void StartREST();
|
||||||
/** Interrupt RPC REST subsystem.
|
/** Interrupt RPC REST subsystem.
|
||||||
*/
|
*/
|
||||||
void InterruptREST();
|
void InterruptREST();
|
||||||
|
|
|
@ -736,8 +736,7 @@ static bool AppInitServers()
|
||||||
StartRPC();
|
StartRPC();
|
||||||
if (!StartHTTPRPC())
|
if (!StartHTTPRPC())
|
||||||
return false;
|
return false;
|
||||||
if (gArgs.GetBoolArg("-rest", DEFAULT_REST_ENABLE) && !StartREST())
|
if (gArgs.GetBoolArg("-rest", DEFAULT_REST_ENABLE)) StartREST();
|
||||||
return false;
|
|
||||||
StartHTTPServer();
|
StartHTTPServer();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -591,11 +591,10 @@ static const struct {
|
||||||
{"/rest/getutxos", rest_getutxos},
|
{"/rest/getutxos", rest_getutxos},
|
||||||
};
|
};
|
||||||
|
|
||||||
bool StartREST()
|
void StartREST()
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < ARRAYLEN(uri_prefixes); i++)
|
for (unsigned int i = 0; i < ARRAYLEN(uri_prefixes); i++)
|
||||||
RegisterHTTPHandler(uri_prefixes[i].prefix, false, uri_prefixes[i].handler);
|
RegisterHTTPHandler(uri_prefixes[i].prefix, false, uri_prefixes[i].handler);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterruptREST()
|
void InterruptREST()
|
||||||
|
|
Loading…
Reference in a new issue