import_wallet_request improvments

new_rpc
moneroexamples 5 years ago
parent 4939545c02
commit ca0f5c2035

@ -89,7 +89,10 @@ thinwalletCtrls.controller("ImportWalletCtrl", function($scope, $location, $http
$timeout(function(){ModalService.hide('import-wallet')}, 5000); $timeout(function(){ModalService.hide('import-wallet')}, 5000);
} }
},function(response) { },function(response) {
$scope.error = "Error connecting to the backend. Can't get payment import data."; var data = response.data;
$scope.error = data && data.Error
? data.Error
: "Something went wrong getting payment details";
}); });
} }

@ -985,11 +985,36 @@ void
YourMoneroRequests::import_wallet_request( YourMoneroRequests::import_wallet_request(
const shared_ptr< Session > session, const Bytes & body) const shared_ptr< Session > session, const Bytes & body)
{ {
json j_request = body_to_json(body);
string xmr_address = j_request["address"];
json j_response; json j_response;
json j_request;
vector<string> requested_values {"address" , "view_key"};
if (!parse_request(body, requested_values,
j_request, j_response))
{
session_close(session, j_response, UNPROCESSABLE_ENTITY,
"Cant parse json body!");
return;
}
string xmr_address;
string view_key;
try
{
xmr_address = j_request["address"];
view_key = j_request["view_key"];
}
catch (json::exception const& e)
{
OMERROR << "json exception: " << e.what();
session_close(session, j_response, UNPROCESSABLE_ENTITY,
e.what());
return;
}
j_response["request_fulfilled"] = false; j_response["request_fulfilled"] = false;
j_response["import_fee"] = std::to_string( j_response["import_fee"] = std::to_string(
@ -1035,16 +1060,21 @@ YourMoneroRequests::import_wallet_request(
return; return;
} }
// payment fee is not zero, so we need to
// ask for the payment. So we first get payment details
// associated with the given account.
auto xmr_payment = select_payment(*xmr_account); auto xmr_payment = select_payment(*xmr_account);
// something went wrong.
if (!xmr_payment) if (!xmr_payment)
{ {
session_close(session, j_response, UNPROCESSABLE_ENTITY, session_close(session, j_response, UNPROCESSABLE_ENTITY,
"Selecting payment details faild!"); "Selecting payment details failed!");
return; return;
} }
// payment id is null
if (xmr_payment->id == mysqlpp::null) if (xmr_payment->id == mysqlpp::null)
{ {
// no current payment record exist, // no current payment record exist,
@ -1095,13 +1125,43 @@ YourMoneroRequests::import_wallet_request(
return; return;
} // if (xmr_payment->id == mysqlpp::null) } // if (xmr_payment->id == mysqlpp::null)
// payment id is not null, so it means that
// we have already payment record in our db for that
// account.
bool request_fulfilled = bool {xmr_payment->request_fulfilled}; bool request_fulfilled = bool {xmr_payment->request_fulfilled};
if (request_fulfilled)
{
// if payment has been made, and we get new request to import txs
// indicate that this is new requeest, but request was fulfiled.
// front end should give proper message in this case
j_response["request_fulfilled"] = request_fulfilled;
j_response["status"] = "Wallet already imported or "
"in the progress.";
j_response["new_request"] = false;
j_response["error"] = "";
session_close(session, j_response);
return;
}
// payment has not been yet done, so we are going
// to check if it has just been done and update
// db accordingly
string integrated_address = string integrated_address =
current_bc_status->get_account_integrated_address_as_str( current_bc_status->get_account_integrated_address_as_str(
xmr_payment->payment_id); xmr_payment->payment_id);
if (integrated_address.empty())
{
session_close(session, j_response, UNPROCESSABLE_ENTITY,
"get_account_integrated_address_as_str failed!");
return;
}
j_response["payment_id"] = xmr_payment->payment_id; j_response["payment_id"] = xmr_payment->payment_id;
j_response["import_fee"] = std::to_string(xmr_payment->import_fee); j_response["import_fee"] = std::to_string(xmr_payment->import_fee);
j_response["new_request"] = false; j_response["new_request"] = false;
@ -1112,91 +1172,70 @@ YourMoneroRequests::import_wallet_request(
string tx_hash_with_payment; string tx_hash_with_payment;
// if payment has not yet been done // if payment has not yet been done
if (!request_fulfilled) // check if it has just been done now
{ // if yes, mark it in mysql
// check if it has just been done now
// if yes, mark it in mysql
if(current_bc_status->search_if_payment_made(
xmr_payment->payment_id,
xmr_payment->import_fee,
tx_hash_with_payment))
{
XmrPayment updated_xmr_payment = *xmr_payment;
// updated values if(current_bc_status->search_if_payment_made(
updated_xmr_payment.request_fulfilled = true; xmr_payment->payment_id,
updated_xmr_payment.tx_hash = tx_hash_with_payment; xmr_payment->import_fee,
tx_hash_with_payment))
{
XmrPayment updated_xmr_payment = *xmr_payment;
// save to mysql // updated values
if (xmr_accounts->update(*xmr_payment, updated_xmr_payment)) updated_xmr_payment.request_fulfilled = true;
{ updated_xmr_payment.tx_hash = tx_hash_with_payment;
// set scanned_block_height to 0 to begin // save to mysql
// scanning entire blockchain if (!xmr_accounts->update(*xmr_payment, updated_xmr_payment))
{
XmrAccount acc; OMERROR << xmr_address.substr(0,6) +
"Updating payment db failed!\n";
if (xmr_accounts->select(xmr_address, acc)) session_close(session, j_response, UNPROCESSABLE_ENTITY,
{ "Updating payment db failed!");
XmrAccount updated_acc = acc; return;
}
updated_acc.scanned_block_height = 0; XmrAccount updated_acc = *xmr_account;
if (xmr_accounts->update(acc, updated_acc)) updated_acc.scanned_block_height = 0;
{
// if success, set acc to updated_acc;
request_fulfilled = true;
// change search blk number in the search thread // set scanned_block_height to 0 to begin
if (!current_bc_status // scanning entire blockchain
->set_new_searched_blk_no(xmr_address, 0))
{
OMERROR << xmr_address.substr(0,6) +
": updating searched_blk_no failed!\n";
j_response["error"] = "Updating searched_blk_no"
" failed!";
}
j_response["request_fulfilled"] if (!xmr_accounts->update(*xmr_account, updated_acc))
= request_fulfilled; {
j_response["status"] OMERROR << xmr_address.substr(0,6) +
= "Payment received. Thank you."; "Updating scanned_block_height failed!\n";
j_response["new_request"] = true;
j_response["error"] = "";
}
}
else
{
OMERROR << xmr_address.substr(0,6) +
": updating accounts "
"payment db failed! \n";
j_response["error"]
= "Updating accounts "
"payment db failed!";
}
}
else
{
OMERROR << xmr_address.substr(0,6) +
"Updating payment db failed!\n";
j_response["error"] = "Updating payment mysql failed!";
}
} // if(current_bc_status->search_if_payment_made( session_close(session, j_response, UNPROCESSABLE_ENTITY,
"Updating scanned_block_height failed!");
return;
}
} // if (!request_fulfilled) // if success, set acc to updated_acc;
else request_fulfilled = true;
{
// if payment has been made, and we get new request to import txs
// indicate that this is new requeest, but request was fulfiled.
// front end should give proper message in this case
j_response["request_fulfilled"] = request_fulfilled; // change search blk number in the search thread
j_response["status"] = "Wallet already imported or " if (!current_bc_status
"in the progress."; ->set_new_searched_blk_no(xmr_address, 0))
j_response["new_request"] = false; {
OMERROR << xmr_address.substr(0,6) +
": updating searched_blk_no failed!\n";
j_response["error"] = "Updating searched_blk_no"
" failed!";
}
j_response["request_fulfilled"]
= request_fulfilled;
j_response["status"]
= "Payment received. Thank you.";
j_response["new_request"] = true;
j_response["error"] = ""; j_response["error"] = "";
}
} // if(current_bc_status->search_if_payment_made(
session_close(session, j_response); session_close(session, j_response);
@ -1218,10 +1257,11 @@ YourMoneroRequests::import_recent_wallet_request(
vector<string> requested_values {"address" , "view_key", vector<string> requested_values {"address" , "view_key",
"no_blocks_to_import"}; "no_blocks_to_import"};
if (!parse_request(body, requested_values, j_request, j_response)) if (!parse_request(body, requested_values,
j_request, j_response))
{ {
j_response["Error"] = "Cant parse json body"; session_close(session, j_response, UNPROCESSABLE_ENTITY,
session_close(session, j_response); "Cant parse json body!");
return; return;
} }
@ -1235,8 +1275,9 @@ YourMoneroRequests::import_recent_wallet_request(
} }
catch (json::exception const& e) catch (json::exception const& e)
{ {
cerr << "json exception: " << e.what() << '\n'; OMERROR << "json exception: " << e.what();
session_close(session, j_response); session_close(session, j_response, UNPROCESSABLE_ENTITY,
e.what());
return; return;
} }
@ -1954,7 +1995,7 @@ boost::optional<XmrAccount>
YourMoneroRequests::select_account( YourMoneroRequests::select_account(
string const& xmr_address) const string const& xmr_address) const
{ {
boost::optional<XmrAccount> acc; boost::optional<XmrAccount> acc = XmrAccount{};
if (!xmr_accounts->select(xmr_address, *acc)) if (!xmr_accounts->select(xmr_address, *acc))
{ {
@ -1964,7 +2005,7 @@ YourMoneroRequests::select_account(
return acc; return acc;
} }
return {}; return acc;
} }
boost::optional<XmrPayment> boost::optional<XmrPayment>
@ -1976,9 +2017,15 @@ YourMoneroRequests::select_payment(
if (!xmr_accounts->select(xmr_account.id.data, if (!xmr_accounts->select(xmr_account.id.data,
xmr_payments)) xmr_payments))
{ {
OMERROR << xmr_account.address.substr(0,6) + OMINFO << xmr_account.address.substr(0,6) +
": address does not exists!"; ": no payment record found!";
return {};
// so create empty record to be inserted into
// db after.
XmrPayment xmr_payment;
xmr_payment.id = mysqlpp::null;
return xmr_payment;
} }
if (xmr_payments.size() > 1) if (xmr_payments.size() > 1)
@ -1993,13 +2040,19 @@ YourMoneroRequests::select_payment(
// paymnet record created. so new // paymnet record created. so new
// paymnet will be created // paymnet will be created
if (xmr_payments.empty()) if (xmr_payments.empty())
{ {
OMINFO << xmr_account.address.substr(0,6) + OMINFO << xmr_account.address.substr(0,6) +
": no payment record found!"; ": no payment record found!";
return {XmrPayment{}};
// so create empty record to be inserted into
// db after.
XmrPayment xmr_payment;
xmr_payment.id = mysqlpp::null;
return xmr_payment;
} }
return {xmr_payments.at(1)}; return xmr_payments.at(0);
} }
void void
@ -2011,7 +2064,7 @@ YourMoneroRequests::session_close(
{ {
if (return_code != OK) if (return_code != OK)
{ {
j_response["error"] = error_msg; j_response["Error"] = error_msg;
} }
string response_body = j_response.dump(); string response_body = j_response.dump();

@ -19,7 +19,8 @@ MysqlInputs::MysqlInputs(shared_ptr<MySqlConnector> _conn)
{} {}
bool bool
MysqlInputs::select_for_out(const uint64_t& output_id, vector<XmrInput>& ins) MysqlInputs::select_for_out(const uint64_t& output_id,
vector<XmrInput>& ins)
{ {
try try
{ {
@ -77,7 +78,8 @@ MysqlOutpus::exist(const string& output_public_key_str, XmrOutput& out)
} }
MysqlTransactions::MysqlTransactions(shared_ptr<MySqlConnector> _conn): conn {_conn} MysqlTransactions::MysqlTransactions(shared_ptr<MySqlConnector> _conn)
: conn {_conn}
{} {}
uint64_t uint64_t
@ -87,9 +89,10 @@ MysqlTransactions::mark_spendable(const uint64_t& tx_id_no, bool spendable)
{ {
conn->check_if_connected(); conn->check_if_connected();
Query query = conn->query(spendable ? Query query = conn->query(
XmrTransaction::MARK_AS_SPENDABLE_STMT spendable ?
: XmrTransaction::MARK_AS_NONSPENDABLE_STMT); XmrTransaction::MARK_AS_SPENDABLE_STMT
: XmrTransaction::MARK_AS_NONSPENDABLE_STMT);
query.parse(); query.parse();
@ -131,7 +134,8 @@ MysqlTransactions::delete_tx(const uint64_t& tx_id_no)
bool bool
MysqlTransactions::exist(const uint64_t& account_id, const string& tx_hash_str, XmrTransaction& tx) MysqlTransactions::exist(const uint64_t& account_id,
const string& tx_hash_str, XmrTransaction& tx)
{ {
try try
{ {
@ -161,7 +165,8 @@ MysqlTransactions::exist(const uint64_t& account_id, const string& tx_hash_str,
bool bool
MysqlTransactions::get_total_recieved(const uint64_t& account_id, uint64_t& amount) MysqlTransactions::get_total_recieved(const uint64_t& account_id,
uint64_t& amount)
{ {
try try
{ {
@ -190,7 +195,8 @@ MysqlPayments::MysqlPayments(shared_ptr<MySqlConnector> _conn): conn {_conn}
{} {}
bool bool
MysqlPayments::select_by_payment_id(const string& payment_id, vector<XmrPayment>& payments) MysqlPayments::select_by_payment_id(const string& payment_id,
vector<XmrPayment>& payments)
{ {
try try
@ -214,7 +220,8 @@ MysqlPayments::select_by_payment_id(const string& payment_id, vector<XmrPayment>
return false; return false;
} }
MySqlAccounts::MySqlAccounts(shared_ptr<CurrentBlockchainStatus> _current_bc_status) MySqlAccounts::MySqlAccounts(
shared_ptr<CurrentBlockchainStatus> _current_bc_status)
: current_bc_status {_current_bc_status} : current_bc_status {_current_bc_status}
{ {
// create connection to the mysql // create connection to the mysql
@ -223,8 +230,9 @@ MySqlAccounts::MySqlAccounts(shared_ptr<CurrentBlockchainStatus> _current_bc_sta
_init(); _init();
} }
MySqlAccounts::MySqlAccounts(shared_ptr<CurrentBlockchainStatus> _current_bc_status, MySqlAccounts::MySqlAccounts(
shared_ptr<MySqlConnector> _conn) shared_ptr<CurrentBlockchainStatus> _current_bc_status,
shared_ptr<MySqlConnector> _conn)
: current_bc_status {_current_bc_status} : current_bc_status {_current_bc_status}
{ {
conn = _conn; conn = _conn;
@ -292,7 +300,8 @@ MySqlAccounts::insert(const T& data_to_insert)
template template
uint64_t MySqlAccounts::insert<XmrAccount>(const XmrAccount& data_to_insert); uint64_t MySqlAccounts::insert<XmrAccount>(const XmrAccount& data_to_insert);
template template
uint64_t MySqlAccounts::insert<XmrTransaction>(const XmrTransaction& data_to_insert); uint64_t MySqlAccounts::insert<XmrTransaction>(
const XmrTransaction& data_to_insert);
template template
uint64_t MySqlAccounts::insert<XmrOutput>(const XmrOutput& data_to_insert); uint64_t MySqlAccounts::insert<XmrOutput>(const XmrOutput& data_to_insert);
template template
@ -327,9 +336,12 @@ MySqlAccounts::insert(const vector<T>& data_to_insert)
// Explicitly instantiate insert template for our tables // Explicitly instantiate insert template for our tables
template template
uint64_t MySqlAccounts::insert<XmrOutput>(const vector<XmrOutput>& data_to_insert); uint64_t MySqlAccounts::insert<XmrOutput>(
const vector<XmrOutput>& data_to_insert);
template template
uint64_t MySqlAccounts::insert<XmrInput>(const vector<XmrInput>& data_to_insert); uint64_t MySqlAccounts::insert<XmrInput>(
const vector<XmrInput>& data_to_insert);
template <typename T, size_t query_no> template <typename T, size_t query_no>
bool bool
@ -339,14 +351,18 @@ MySqlAccounts::select(uint64_t account_id, vector<T>& selected_data)
{ {
conn->check_if_connected(); conn->check_if_connected();
Query query = conn->query((query_no == 1 ? T::SELECT_STMT : T::SELECT_STMT2)); Query query = conn->query((query_no == 1
? T::SELECT_STMT : T::SELECT_STMT2));
query.parse(); query.parse();
selected_data.clear(); selected_data.clear();
query.storein(selected_data, account_id); query.storein(selected_data, account_id);
// this is confusing. So I get false from this method
// when this is empty and when there is some exception!
return !selected_data.empty(); return !selected_data.empty();
//return true;
} }
catch (std::exception const& e) catch (std::exception const& e)
{ {
@ -357,25 +373,34 @@ MySqlAccounts::select(uint64_t account_id, vector<T>& selected_data)
} }
template template
bool MySqlAccounts::select<XmrAccount>(uint64_t account_id, vector<XmrAccount>& selected_data); bool MySqlAccounts::select<XmrAccount>(uint64_t account_id,
vector<XmrAccount>& selected_data);
template template
bool MySqlAccounts::select<XmrTransaction>(uint64_t account_id, vector<XmrTransaction>& selected_data); bool MySqlAccounts::select<XmrTransaction>(uint64_t account_id,
vector<XmrTransaction>& selected_data);
template template
bool MySqlAccounts::select<XmrOutput>(uint64_t account_id, vector<XmrOutput>& selected_data); bool MySqlAccounts::select<XmrOutput>(uint64_t account_id,
vector<XmrOutput>& selected_data);
template // this will use SELECT_STMT2 which selectes based on transaction id, not account_id, template // this will use SELECT_STMT2 which selectes
bool MySqlAccounts::select<XmrOutput, 2>(uint64_t tx_id, vector<XmrOutput>& selected_data); // based on transaction id, not account_id,
bool MySqlAccounts::select<XmrOutput, 2>(uint64_t tx_id,
vector<XmrOutput>& selected_data);
template template
bool MySqlAccounts::select<XmrInput>(uint64_t account_id, vector<XmrInput>& selected_data); bool MySqlAccounts::select<XmrInput>(uint64_t account_id,
vector<XmrInput>& selected_data);
template template
bool MySqlAccounts::select<XmrPayment>(uint64_t account_id, vector<XmrPayment>& selected_data); bool MySqlAccounts::select<XmrPayment>(uint64_t account_id,
vector<XmrPayment>& selected_data);
template // this will use SELECT_STMT2 which selectes based on transaction id, not account_id, template // this will use SELECT_STMT2 which selectes
bool MySqlAccounts::select<XmrInput, 2>(uint64_t tx_id, vector<XmrInput>& selected_data); // based on transaction id, not account_id,
bool MySqlAccounts::select<XmrInput, 2>(uint64_t tx_id,
vector<XmrInput>& selected_data);
template <typename T> template <typename T>
@ -403,10 +428,12 @@ MySqlAccounts::update(T const& orginal_row, T const& new_row)
} }
template template
bool MySqlAccounts::update<XmrAccount>(XmrAccount const& orginal_row, XmrAccount const& new_row); bool MySqlAccounts::update<XmrAccount>(
XmrAccount const& orginal_row, XmrAccount const& new_row);
template template
bool MySqlAccounts::update<XmrPayment>(XmrPayment const& orginal_row, XmrPayment const& new_row); bool MySqlAccounts::update<XmrPayment>(
XmrPayment const& orginal_row, XmrPayment const& new_row);
template <typename T> template <typename T>
bool bool
@ -415,12 +442,16 @@ MySqlAccounts::select_for_tx(uint64_t tx_id, vector<T>& selected_data)
return select<T, 2>(tx_id, selected_data); return select<T, 2>(tx_id, selected_data);
} }
template // this will use SELECT_STMT2 which selectes based on transaction id, not account_id, template // this will use SELECT_STMT2 which selectes based on
bool MySqlAccounts::select_for_tx<XmrOutput>(uint64_t tx_id, vector<XmrOutput>& selected_data); // transaction id, not account_id,
bool MySqlAccounts::select_for_tx<XmrOutput>(uint64_t tx_id,
vector<XmrOutput>& selected_data);
template // this will use SELECT_STMT2 which selectes based on transaction id, not account_id, template // this will use SELECT_STMT2 which selectes
bool MySqlAccounts::select_for_tx<XmrInput>(uint64_t tx_id, vector<XmrInput>& selected_data); //based on transaction id, not account_id,
bool MySqlAccounts::select_for_tx<XmrInput>(uint64_t tx_id,
vector<XmrInput>& selected_data);
template <typename T> template <typename T>
bool bool
@ -453,16 +484,20 @@ MySqlAccounts::select_by_primary_id(uint64_t id, T& selected_data)
} }
//template //template
//bool MySqlAccounts::select_by_primary_id<XmrTransaction>(uint64_t id, XmrTransaction& selected_data); //bool MySqlAccounts::select_by_primary_id<XmrTransaction>(
// uint64_t id, XmrTransaction& selected_data);
template template
bool MySqlAccounts::select_by_primary_id<XmrInput>(uint64_t id, XmrInput& selected_data); bool MySqlAccounts::select_by_primary_id<XmrInput>(
uint64_t id, XmrInput& selected_data);
template template
bool MySqlAccounts::select_by_primary_id<XmrOutput>(uint64_t id, XmrOutput& selected_data); bool MySqlAccounts::select_by_primary_id<XmrOutput>(
uint64_t id, XmrOutput& selected_data);
template template
bool MySqlAccounts::select_by_primary_id<XmrPayment>(uint64_t id, XmrPayment& selected_data); bool MySqlAccounts::select_by_primary_id<XmrPayment>(
uint64_t id, XmrPayment& selected_data);
bool bool
MySqlAccounts::select_txs_for_account_spendability_check( MySqlAccounts::select_txs_for_account_spendability_check(
@ -492,7 +527,8 @@ MySqlAccounts::select_txs_for_account_spendability_check(
if (no_row_updated != 1) if (no_row_updated != 1)
{ {
cerr << "no_row_updated != 1 due to xmr_accounts->mark_tx_spendable(tx.id)\n"; cerr << "no_row_updated != 1 due to "
"xmr_accounts->mark_tx_spendable(tx.id)\n";
return false; return false;
} }
@ -512,14 +548,16 @@ MySqlAccounts::select_txs_for_account_spendability_check(
if (blockchain_tx_id != tx.blockchain_tx_id) if (blockchain_tx_id != tx.blockchain_tx_id)
{ {
// tx does not exist in blockchain, or its blockchain_id changed // tx does not exist in blockchain, or its blockchain_id
// changed
// for example, it was orhpaned, and then readded. // for example, it was orhpaned, and then readded.
uint64_t no_row_updated = delete_tx(tx.id.data); uint64_t no_row_updated = delete_tx(tx.id.data);
if (no_row_updated != 1) if (no_row_updated != 1)
{ {
cerr << "no_row_updated != 1 due to xmr_accounts->delete_tx(tx.id)\n"; cerr << "no_row_updated != 1 due to "
"xmr_accounts->delete_tx(tx.id)\n";
return false; return false;
} }
@ -539,7 +577,8 @@ MySqlAccounts::select_txs_for_account_spendability_check(
// be spent anyway. // be spent anyway.
if (tx.unlock_time == 0) if (tx.unlock_time == 0)
tx.unlock_time = tx.height + CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE; tx.unlock_time = tx.height
+ CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE;
} // else } // else
@ -555,19 +594,22 @@ MySqlAccounts::select_txs_for_account_spendability_check(
bool bool
MySqlAccounts::select_inputs_for_out(const uint64_t& output_id, vector<XmrInput>& ins) MySqlAccounts::select_inputs_for_out(const uint64_t& output_id,
vector<XmrInput>& ins)
{ {
return mysql_in->select_for_out(output_id, ins); return mysql_in->select_for_out(output_id, ins);
} }
bool bool
MySqlAccounts::output_exists(const string& output_public_key_str, XmrOutput& out) MySqlAccounts::output_exists(const string& output_public_key_str,
XmrOutput& out)
{ {
return mysql_out->exist(output_public_key_str, out); return mysql_out->exist(output_public_key_str, out);
} }
bool bool
MySqlAccounts::tx_exists(const uint64_t& account_id, const string& tx_hash_str, XmrTransaction& tx) MySqlAccounts::tx_exists(const uint64_t& account_id,
const string& tx_hash_str, XmrTransaction& tx)
{ {
return mysql_tx->exist(account_id, tx_hash_str, tx); return mysql_tx->exist(account_id, tx_hash_str, tx);
} }
@ -591,13 +633,15 @@ MySqlAccounts::delete_tx(const uint64_t& tx_id_no)
} }
bool bool
MySqlAccounts::select_payment_by_id(const string& payment_id, vector<XmrPayment>& payments) MySqlAccounts::select_payment_by_id(const string& payment_id,
vector<XmrPayment>& payments)
{ {
return mysql_payment->select_by_payment_id(payment_id, payments); return mysql_payment->select_by_payment_id(payment_id, payments);
} }
bool bool
MySqlAccounts::get_total_recieved(const uint64_t& account_id, uint64_t& amount) MySqlAccounts::get_total_recieved(const uint64_t& account_id,
uint64_t& amount)
{ {
return mysql_tx->get_total_recieved(account_id, amount); return mysql_tx->get_total_recieved(account_id, amount);
} }
@ -617,7 +661,8 @@ MySqlAccounts::get_connection()
void void
MySqlAccounts::set_bc_status_provider(shared_ptr<CurrentBlockchainStatus> bc_status_provider) MySqlAccounts::set_bc_status_provider(
shared_ptr<CurrentBlockchainStatus> bc_status_provider)
{ {
current_bc_status = bc_status_provider; current_bc_status = bc_status_provider;
} }

Loading…
Cancel
Save