show error when login fails due to search thread start failure

pull/5/head
moneroexamples 7 years ago
parent c5b2e9232c
commit f0e72ba614

@ -28,7 +28,10 @@ They include:
- [http://139.162.32.245:81](http://139.162.32.245:81) - [http://139.162.32.245:81](http://139.162.32.245:81)
This is Open Monero running on testnet network. You can use it to play around with it. This is Open Monero running on testnet network. You can use it to play around with it.
Since this is testnet version, frequent changes and database resets are expected. Since this is testnet version, frequent changes and database resets are expected.
If you want some testnet monero, please make issue with your testnet address that you can
obtained from Open Monero.
## Screenshot ## Screenshot
@ -173,7 +176,7 @@ Before running `openmonero`:
- edit `config/confing.js` file with your settings. Especially set `frontend-url` and `database` - edit `config/confing.js` file with your settings. Especially set `frontend-url` and `database`
connection details. connection details.
- set `apiUrl` in `html\js\config.js`. Last slash `/` in `apiUrl` is important. - set `apiUrl` in `html\js\config.js`. Last slash `/` in `apiUrl` is important.
- make sure monero deamon is running and fully sync. If using testnet network, use deamon - make sure monero daemon is running and fully sync. If using testnet network, use daemon
with testnet flag! with testnet flag!
@ -187,7 +190,11 @@ To start for testnet:
./openmonero -t ./openmonero -t
``` ```
To start for testnet with non-default location of `config.json` file:
```bash
./openmonero -t -c /path/to/config.js
```
## Scrap notes ## Scrap notes

@ -107,6 +107,12 @@ thinwalletServices
}) })
.success(function(data) { .success(function(data) {
// set account_imported to true if we are not logging in with a newly generated account, and a new account was created on the server // set account_imported to true if we are not logging in with a newly generated account, and a new account was created on the server
if (data.status === "error")
{
accountService.logout();
deferred.reject(data.reason);
return;
}
account_imported = !generated_account && data.new_address; account_imported = !generated_account && data.new_address;
logging_in = false; logging_in = false;
$rootScope.$broadcast(EVENT_CODES.authStatusChanged); $rootScope.$broadcast(EVENT_CODES.authStatusChanged);

@ -663,8 +663,16 @@ CurrentBlockchainStatus::start_tx_search_thread(XmrAccount acc)
return false; return false;
} }
// make a tx_search object for the given xmr account try
searching_threads[acc.address] = make_shared<TxSearch>(acc); {
// make a tx_search object for the given xmr account
searching_threads[acc.address] = make_shared<TxSearch>(acc);
}
catch (const std::exception& e)
{
cerr << "Faild created a search thread " << endl;
return false;
}
// start the thread for the created object // start the thread for the created object
std::thread t1 {&TxSearch::search, searching_threads[acc.address].get()}; std::thread t1 {&TxSearch::search, searching_threads[acc.address].get()};

@ -749,6 +749,8 @@ MySqlAccounts::insert(const string& address, const uint64_t& current_blkchain_he
// set to current blockchain height // set to current blockchain height
// when account is created. // when account is created.
//cout << "insert address: " << address << endl;
SimpleResult sr = query.execute(address, SimpleResult sr = query.execute(address,
current_blkchain_height, current_blkchain_height,
current_blkchain_height); current_blkchain_height);

@ -91,6 +91,12 @@ YourMoneroRequests::login(const shared_ptr<Session> session, const Bytes & body)
if (CurrentBlockchainStatus::start_tx_search_thread(acc)) if (CurrentBlockchainStatus::start_tx_search_thread(acc))
{ {
cout << "Search thread started" << endl; cout << "Search thread started" << endl;
j_response["status"] = "OK";
}
else
{
j_response["status"] = "error";
j_response["reason"] = "Failed created search thread for this account";
} }
string response_body = j_response.dump(); string response_body = j_response.dump();

Loading…
Cancel
Save