fix login with new address

use_xmregcore
moneroexamples 5 years ago
parent 8630bbbef4
commit 915799fe2e

@ -34,7 +34,7 @@
"wallet_import" :
{
"_comment": "if fee is 0, then importing is free. fee is in base 1e12, e.g., 0.1 xmr is 0.1 x 1e12 = 100000000000",
"fee" : 0,
"fee" : 1000000,
"testnet" :
{
"address" : "9tzmPMTViHYM3z6NAgQni1Qm1Emzxy5hQFibPgWD3LVTAz91yok5Eni1pH6zKhBHzpTU15GZooPHSGHXFvFuXEdmEG2sWAZ",

@ -76,7 +76,7 @@ OpenMoneroRequests::login(const shared_ptr<Session> session, const Bytes & body)
// marks if this is new account creation or not
bool new_account_created {false};
auto acc = select_account(xmr_address, view_key);
auto acc = select_account(xmr_address, view_key, false);
// first check if new account
// select this account if its existing one
@ -84,11 +84,7 @@ OpenMoneroRequests::login(const shared_ptr<Session> session, const Bytes & body)
{
// account does not exist, so create new one
// for this address
acc = create_account(xmr_address, view_key);
// insert the new account into the mysql
if (!acc)
if (!(acc = create_account(xmr_address, view_key)))
{
// if creating account failed
j_response = json {{"status", "error"},

Loading…
Cancel
Save