|
|
|
@ -194,13 +194,14 @@ TxSearch::search()
|
|
|
|
|
tx_data.account_id = acc->id;
|
|
|
|
|
tx_data.total_received = oi_identification.total_received;
|
|
|
|
|
tx_data.total_sent = 0; // at this stage we don't have any
|
|
|
|
|
// info about spendings
|
|
|
|
|
tx_data.unlock_time = 0;
|
|
|
|
|
// info about spendings
|
|
|
|
|
tx_data.unlock_time = 0; // this seems to be not used at all
|
|
|
|
|
// in frontend
|
|
|
|
|
tx_data.height = searched_blk_no;
|
|
|
|
|
tx_data.coinbase = oi_identification.tx_is_coinbase;
|
|
|
|
|
tx_data.spendable = is_spendable;
|
|
|
|
|
tx_data.payment_id = CurrentBlockchainStatus::get_payment_id_as_string(tx);
|
|
|
|
|
tx_data.mixin = get_mixin_no(tx) - 1;
|
|
|
|
|
tx_data.mixin = oi_identification.mixin_no;
|
|
|
|
|
tx_data.timestamp = blk_timestamp_mysql_format;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -456,14 +457,20 @@ TxSearch::populate_known_outputs()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
json
|
|
|
|
|
TxSearch::find_txs_in_mempool(vector<transaction> mempool_txs)
|
|
|
|
|
TxSearch::find_txs_in_mempool(
|
|
|
|
|
vector<pair<uint64_t, transaction>> mempool_txs)
|
|
|
|
|
{
|
|
|
|
|
json j_transactions = json::array();
|
|
|
|
|
|
|
|
|
|
uint64_t current_height = CurrentBlockchainStatus::get_current_blockchain_height();
|
|
|
|
|
|
|
|
|
|
for (const transaction& tx: mempool_txs)
|
|
|
|
|
for (const pair<uint64_t, transaction>& mtx: mempool_txs)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
uint64_t recieve_time = mtx.first;
|
|
|
|
|
|
|
|
|
|
const transaction& tx = mtx.second;
|
|
|
|
|
|
|
|
|
|
// Class that is resposnible for idenficitaction of our outputs
|
|
|
|
|
// and inputs in a given tx.
|
|
|
|
|
OutputInputIdentification oi_identification {&address, &viewkey, &tx};
|
|
|
|
@ -480,19 +487,20 @@ TxSearch::find_txs_in_mempool(vector<transaction> mempool_txs)
|
|
|
|
|
{
|
|
|
|
|
json j_tx;
|
|
|
|
|
|
|
|
|
|
j_tx["id"] = 0;
|
|
|
|
|
j_tx["id"] = 0; // dont have any database id for tx in mempool
|
|
|
|
|
j_tx["hash"] = oi_identification.tx_hash_str;
|
|
|
|
|
j_tx["timestamp"] = "";
|
|
|
|
|
j_tx["timestamp"] = timestamp_to_str(recieve_time); // when it got into mempool
|
|
|
|
|
j_tx["total_received"] = oi_identification.total_received;
|
|
|
|
|
j_tx["total_sent"] = 0;
|
|
|
|
|
j_tx["total_sent"] = 0; // to be set later when looking for key images
|
|
|
|
|
j_tx["unlock_time"] = 0;
|
|
|
|
|
j_tx["height"] = current_height; // put large value of height,
|
|
|
|
|
// just to indicate that we dont have
|
|
|
|
|
// height and that in frontend it will
|
|
|
|
|
// appear us unconfirmed.
|
|
|
|
|
j_tx["payment_id"] = "";
|
|
|
|
|
j_tx["coinbase"] = false;
|
|
|
|
|
j_tx["height"] = current_height; // put current blockchain height,
|
|
|
|
|
// just to indicate to frontend that this
|
|
|
|
|
// tx is younger than 10 blocks so that
|
|
|
|
|
// it shows unconfirmed message.
|
|
|
|
|
j_tx["payment_id"] = CurrentBlockchainStatus::get_payment_id_as_string(tx);
|
|
|
|
|
j_tx["coinbase"] = false; // mempool tx are not coinbase, so always false
|
|
|
|
|
j_tx["mixin"] = get_mixin_no(tx) - 1;
|
|
|
|
|
j_tx["mempool"] = true;
|
|
|
|
|
|
|
|
|
|
j_transactions.push_back(j_tx);
|
|
|
|
|
}
|
|
|
|
|