diff --git a/README.md b/README.md index adcd415..3839daa 100644 --- a/README.md +++ b/README.md @@ -227,6 +227,16 @@ Example output: } ``` +### login + +```bash +curl -w "\n" -X POST http://127.0.0.1:1984/login -d '{"address": "A2VTvE8bC9APsWFn3mQzgW8Xfcy2SP2CRUArD6ZtthNaWDuuvyhtBcZ8WDuYMRt1HhcnNQvpXVUavEiZ9waTbyBhP6RM8TV", "view_key": "041a241325326f9d86519b714a9b7f78b29111551757eeb6334d39c21f8b7400"}' +``` + +```json +{"new_address":false,"status":"success"} +``` + #### get_address_info ```bash diff --git a/src/YourMoneroRequests.cpp b/src/YourMoneroRequests.cpp index 9bc109b..b2948c5 100644 --- a/src/YourMoneroRequests.cpp +++ b/src/YourMoneroRequests.cpp @@ -61,7 +61,7 @@ YourMoneroRequests::login(const shared_ptr session, const Bytes & body) auto response_headers = make_headers({{"Content-Length", to_string(response_body.size())}}); - session->close( OK, response_body, response_headers); + session->close(OK, response_body, response_headers); return; } @@ -103,6 +103,7 @@ YourMoneroRequests::login(const shared_ptr session, const Bytes & body) if (CurrentBlockchainStatus::start_tx_search_thread(acc)) { cout << "Search thread started" << endl; + j_response["status"] = "success"; j_response["new_address"] = false; } @@ -111,7 +112,6 @@ YourMoneroRequests::login(const shared_ptr session, const Bytes & body) j_response["status"] = "error"; j_response["reason"] = "Failed created search thread for this account"; } - } else {