|
|
@ -1697,6 +1697,96 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string
|
|
|
|
|
|
|
|
show_ringmembers_hex(string const& tx_hash_str)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
crypto::hash tx_hash;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!epee::string_tools::hex_to_pod(tx_hash_str, tx_hash))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string msg = fmt::format("Cant parse {:s} as tx hash!", tx_hash_str);
|
|
|
|
|
|
|
|
cerr << msg << endl;
|
|
|
|
|
|
|
|
return msg;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// get transaction
|
|
|
|
|
|
|
|
transaction tx;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!mcore->get_tx(tx_hash, tx))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cerr << "Cant get tx in blockchain: " << tx_hash
|
|
|
|
|
|
|
|
<< ". \n Check mempool now" << endl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vector<MempoolStatus::mempool_tx> found_txs;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
search_mempool(tx_hash, found_txs);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (found_txs.empty())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// tx is nowhere to be found :-(
|
|
|
|
|
|
|
|
return string("Cant get tx: " + tx_hash_str);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tx = found_txs.at(0).tx;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vector<txin_to_key> input_key_imgs = xmreg::get_key_images(tx);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<string> all_mixin_outputs;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// make timescale maps for mixins in input
|
|
|
|
|
|
|
|
for (txin_to_key const& in_key: input_key_imgs)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// get absolute offsets of mixins
|
|
|
|
|
|
|
|
std::vector<uint64_t> absolute_offsets
|
|
|
|
|
|
|
|
= cryptonote::relative_output_offsets_to_absolute(
|
|
|
|
|
|
|
|
in_key.key_offsets);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// get public keys of outputs used in the mixins that
|
|
|
|
|
|
|
|
// match to the offests
|
|
|
|
|
|
|
|
std::vector<cryptonote::output_data_t> mixin_outputs;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// before proceeding with geting the outputs based on
|
|
|
|
|
|
|
|
// the amount and absolute offset
|
|
|
|
|
|
|
|
// check how many outputs there are for that amount
|
|
|
|
|
|
|
|
// go to next input if a too large offset was found
|
|
|
|
|
|
|
|
if (are_absolute_offsets_good(absolute_offsets, in_key) == false)
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
core_storage->get_db().get_output_key(in_key.amount,
|
|
|
|
|
|
|
|
absolute_offsets,
|
|
|
|
|
|
|
|
mixin_outputs);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (const OUTPUT_DNE& e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cerr << "get_output_keys: " << e.what() << endl;
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (auto const& mo: mixin_outputs)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
all_mixin_outputs.emplace_back(pod_to_hex(mo));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // for (txin_to_key const& in_key: input_key_imgs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (all_mixin_outputs.empty())
|
|
|
|
|
|
|
|
return string {"No ring members to serialize"};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::ostringstream oss;
|
|
|
|
|
|
|
|
boost::archive::portable_binary_oarchive archive(oss);
|
|
|
|
|
|
|
|
archive << all_mixin_outputs;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return epee::string_tools
|
|
|
|
|
|
|
|
::buff_to_hex_nodelimer(oss.str());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string
|
|
|
|
string
|
|
|
|
show_my_outputs(string tx_hash_str,
|
|
|
|
show_my_outputs(string tx_hash_str,
|
|
|
|
string xmr_address_str,
|
|
|
|
string xmr_address_str,
|
|
|
@ -2114,7 +2204,8 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// before proceeding with geting the outputs based on the amount and absolute offset
|
|
|
|
// before proceeding with geting the outputs based on
|
|
|
|
|
|
|
|
// the amount and absolute offset
|
|
|
|
// check how many outputs there are for that amount
|
|
|
|
// check how many outputs there are for that amount
|
|
|
|
// go to next input if a too large offset was found
|
|
|
|
// go to next input if a too large offset was found
|
|
|
|
if (are_absolute_offsets_good(absolute_offsets, in_key) == false)
|
|
|
|
if (are_absolute_offsets_good(absolute_offsets, in_key) == false)
|
|
|
|