subaddresses added to mempool scanning

add_subaddress
moneroexamples 5 years ago
parent 9b1fa0db78
commit 8bf2730fdc

@ -11,7 +11,7 @@
#include "db/ssqlses.h"
#include "CurrentBlockchainStatus.h"
#include "src/UniversalIdentifier.hpp"
namespace xmreg
{
@ -44,6 +44,18 @@ TxSearch::TxSearch(XmrAccount const& _acc,
+ acc->viewkey);
}
// make instance of Account from xmregcore. We need this to be
// able to identify outputs addressed to subaddresses based
// on the primary address
xmregcore_account = xmreg::make_account(
acc->address, acc->viewkey);
if (!xmregcore_account)
{
throw TxSearchException("Cant create xmregcore_account: "
+ acc->address);
}
populate_known_outputs();
// start searching from last block that we searched for
@ -77,13 +89,6 @@ searching_is_ongoing = true;
MicroCoreAdapter mcore_addapter {current_bc_status_ptr};
// make instance of Account from xmregcore. We need this to be
// able to identify outputs addressed to subaddresses based
// on the primary address
auto xmregcore_account = xmreg::make_account(
acc->address, acc->viewkey);
// we put everything in massive catch, as there are plenty ways in which
// an exceptions can be thrown here. Mostly from mysql.
// but because this is detatch thread, we cant catch them in main thread.
@ -247,6 +252,12 @@ for (auto const& tx_tuple: txs_data)
auto const& outputs_identified
= identifier.get<Output>()->get();
if (!outputs_identified.empty())
{
cout << "outputs_identified.size(): "
<< outputs_identified.size() << '\n';
}
auto total_received = calc_total_xmr(outputs_identified);
vector<uint64_t> amount_specific_indices;
@ -783,8 +794,8 @@ uint8_t rct_type = (is_rct ? tx.rct_signatures.type : 0);
// and inputs in a given tx.
auto identifier = make_identifier(tx,
make_unique<Output>(&address, &viewkey),
make_unique<Input>(&address, &viewkey,
make_unique<Output>(xmregcore_account.get()),
make_unique<Input>(xmregcore_account.get(),
&known_outputs_keys,
&mcore_addapter));

@ -1,6 +1,7 @@
#pragma once
#include "db/MySqlAccounts.h"
#include "src/UniversalIdentifier.hpp"
#include <memory>
#include <mutex>
@ -71,6 +72,7 @@ private:
// represents a row in mysql's Accounts table
shared_ptr<XmrAccount> acc;
unique_ptr<xmreg::Account> xmregcore_account;
// stores known output public keys.
// used as a cash to fast look up of

@ -1 +1 @@
Subproject commit 447ac6fe53057a85f5468da030af24aacaa3fa61
Subproject commit 4356c9892b9903da4410f773ea36a6e4c799be5a
Loading…
Cancel
Save