|
|
|
@ -6,12 +6,12 @@
|
|
|
|
|
|
|
|
|
|
#include "TxSearch.h"
|
|
|
|
|
|
|
|
|
|
#include "db/MySqlAccounts.h"
|
|
|
|
|
//#include "db/MySqlAccounts.h"
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
@ -201,9 +213,14 @@ for (auto const& tx_tuple: txs_data)
|
|
|
|
|
// Class that is responsible for identification of our outputs
|
|
|
|
|
// and inputs in a given tx.
|
|
|
|
|
|
|
|
|
|
//auto identifier = make_identifier(tx,
|
|
|
|
|
//make_unique<Output>(&address, &viewkey),
|
|
|
|
|
//make_unique<Input>(&address, &viewkey,
|
|
|
|
|
//&known_outputs_keys,
|
|
|
|
|
//&mcore_addapter));
|
|
|
|
|
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));
|
|
|
|
|
identifier.identify();
|
|
|
|
@ -235,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;
|
|
|
|
@ -771,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));
|
|
|
|
|
|
|
|
|
|