diff options
| author | Jonas Schnelli <[email protected]> | 2014-11-26 13:51:02 +0100 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2014-11-26 13:51:02 +0100 |
| commit | 78bdc8103ff4c1b2f1f636f9c5564285028f3e19 (patch) | |
| tree | 116367901be37b441a25bd80922336cfaf28f5b2 /src/rest.cpp | |
| parent | [REST] fix headersonly flag for BINARY responses (diff) | |
| download | discoin-78bdc8103ff4c1b2f1f636f9c5564285028f3e19.tar.xz discoin-78bdc8103ff4c1b2f1f636f9c5564285028f3e19.zip | |
[REST] give an appropriate response in warmup phase
Diffstat (limited to 'src/rest.cpp')
| -rw-r--r-- | src/rest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rest.cpp b/src/rest.cpp index 1aa864a30..4953d7e71 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -188,6 +188,10 @@ bool HTTPReq_REST(AcceptedConnection *conn, bool fRun) { try { + std::string statusmessage; + if(RPCIsInWarmup(&statusmessage)) + throw RESTERR(HTTP_SERVICE_UNAVAILABLE, "Service temporarily unavailable: "+statusmessage); + for (unsigned int i = 0; i < ARRAYLEN(uri_prefixes); i++) { unsigned int plen = strlen(uri_prefixes[i].prefix); if (strURI.substr(0, plen) == uri_prefixes[i].prefix) { |