|
|
@ -35,7 +35,7 @@
|
|
|
|
#include <limits>
|
|
|
|
#include <limits>
|
|
|
|
#include <ctime>
|
|
|
|
#include <ctime>
|
|
|
|
#include <future>
|
|
|
|
#include <future>
|
|
|
|
|
|
|
|
#include <type_traits>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TMPL_DIR "./templates"
|
|
|
|
#define TMPL_DIR "./templates"
|
|
|
@ -103,6 +103,43 @@ struct tx_info_cache
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// helper to ignore any number of template parametrs
|
|
|
|
|
|
|
|
template<typename...> using VoidT = void;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// primary template;
|
|
|
|
|
|
|
|
template<typename, typename = VoidT<>>
|
|
|
|
|
|
|
|
struct HasSpanInGetOutputKeyT: std::false_type
|
|
|
|
|
|
|
|
{};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//partial specialization (myy be SFINAEed away)
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
|
|
|
|
struct HasSpanInGetOutputKeyT<
|
|
|
|
|
|
|
|
T,
|
|
|
|
|
|
|
|
VoidT<decltype(std::declval<T>()
|
|
|
|
|
|
|
|
.get_output_key(
|
|
|
|
|
|
|
|
std::declval<const epee::span<const uint64_t>&>(),
|
|
|
|
|
|
|
|
std::declval<const std::vector<uint64_t>&>(),
|
|
|
|
|
|
|
|
std::declval<std::vector<cryptonote::output_data_t>&>()))
|
|
|
|
|
|
|
|
>>: std::true_type
|
|
|
|
|
|
|
|
{};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// primary template;
|
|
|
|
|
|
|
|
template<typename, typename = VoidT<>>
|
|
|
|
|
|
|
|
struct OutputIndicesReturnVectOfVectT : std::false_type
|
|
|
|
|
|
|
|
{};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
|
|
|
|
struct OutputIndicesReturnVectOfVectT<
|
|
|
|
|
|
|
|
T,
|
|
|
|
|
|
|
|
VoidT<decltype(std::declval<T>()
|
|
|
|
|
|
|
|
.get_tx_amount_output_indices(
|
|
|
|
|
|
|
|
uint64_t{}, size_t{})
|
|
|
|
|
|
|
|
.front().front())
|
|
|
|
|
|
|
|
>>: std::true_type
|
|
|
|
|
|
|
|
{};
|
|
|
|
|
|
|
|
|
|
|
|
// indect overload of hash for tx_info_cache::key
|
|
|
|
// indect overload of hash for tx_info_cache::key
|
|
|
|
namespace std
|
|
|
|
namespace std
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -466,7 +503,6 @@ page(MicroCore* _mcore,
|
|
|
|
testnet = nettype == cryptonote::network_type::TESTNET;
|
|
|
|
testnet = nettype == cryptonote::network_type::TESTNET;
|
|
|
|
stagenet = nettype == cryptonote::network_type::STAGENET;
|
|
|
|
stagenet = nettype == cryptonote::network_type::STAGENET;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
no_of_mempool_tx_of_frontpage = 25;
|
|
|
|
no_of_mempool_tx_of_frontpage = 25;
|
|
|
|
|
|
|
|
|
|
|
|
// read template files for all the pages
|
|
|
|
// read template files for all the pages
|
|
|
@ -1720,7 +1756,10 @@ show_ringmembers_hex(string const& tx_hash_str)
|
|
|
|
== false)
|
|
|
|
== false)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
core_storage->get_db().get_output_key(in_key.amount,
|
|
|
|
//core_storage->get_db().get_output_key(in_key.amount,
|
|
|
|
|
|
|
|
// absolute_offsets,
|
|
|
|
|
|
|
|
// mixin_outputs);
|
|
|
|
|
|
|
|
get_output_key<BlockchainDB>(in_key.amount,
|
|
|
|
absolute_offsets,
|
|
|
|
absolute_offsets,
|
|
|
|
mixin_outputs);
|
|
|
|
mixin_outputs);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2008,8 +2047,12 @@ show_ringmemberstx_jsonhex(string const& tx_hash_str)
|
|
|
|
in_key.amount, absolute_offsets, indices);
|
|
|
|
in_key.amount, absolute_offsets, indices);
|
|
|
|
|
|
|
|
|
|
|
|
// get mining ouput info
|
|
|
|
// get mining ouput info
|
|
|
|
core_storage->get_db().get_output_key(
|
|
|
|
//core_storage->get_db().get_output_key(
|
|
|
|
in_key.amount,
|
|
|
|
//in_key.amount,
|
|
|
|
|
|
|
|
//absolute_offsets,
|
|
|
|
|
|
|
|
//mixin_outputs);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get_output_key<BlockchainDB>(in_key.amount,
|
|
|
|
absolute_offsets,
|
|
|
|
absolute_offsets,
|
|
|
|
mixin_outputs);
|
|
|
|
mixin_outputs);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2524,7 +2567,11 @@ show_my_outputs(string tx_hash_str,
|
|
|
|
if (are_absolute_offsets_good(absolute_offsets, in_key) == false)
|
|
|
|
if (are_absolute_offsets_good(absolute_offsets, in_key) == false)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
core_storage->get_db().get_output_key(in_key.amount,
|
|
|
|
//core_storage->get_db().get_output_key(in_key.amount,
|
|
|
|
|
|
|
|
//absolute_offsets,
|
|
|
|
|
|
|
|
//mixin_outputs);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get_output_key<BlockchainDB>(in_key.amount,
|
|
|
|
absolute_offsets,
|
|
|
|
absolute_offsets,
|
|
|
|
mixin_outputs);
|
|
|
|
mixin_outputs);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -4687,7 +4734,11 @@ json_transaction(string tx_hash_str)
|
|
|
|
if (are_absolute_offsets_good(absolute_offsets, in_key) == false)
|
|
|
|
if (are_absolute_offsets_good(absolute_offsets, in_key) == false)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
core_storage->get_db().get_output_key(in_key.amount,
|
|
|
|
//core_storage->get_db().get_output_key(in_key.amount,
|
|
|
|
|
|
|
|
//absolute_offsets,
|
|
|
|
|
|
|
|
//outputs);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get_output_key<BlockchainDB>(in_key.amount,
|
|
|
|
absolute_offsets,
|
|
|
|
absolute_offsets,
|
|
|
|
outputs);
|
|
|
|
outputs);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -6363,7 +6414,11 @@ construct_tx_context(transaction tx, uint16_t with_ring_signatures = 0)
|
|
|
|
|
|
|
|
|
|
|
|
// offsets seems good, so try to get the outputs for the amount and
|
|
|
|
// offsets seems good, so try to get the outputs for the amount and
|
|
|
|
// offsets given
|
|
|
|
// offsets given
|
|
|
|
core_storage->get_db().get_output_key(in_key.amount,
|
|
|
|
//core_storage->get_db().get_output_key(in_key.amount,
|
|
|
|
|
|
|
|
//absolute_offsets,
|
|
|
|
|
|
|
|
//outputs);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get_output_key<BlockchainDB>(in_key.amount,
|
|
|
|
absolute_offsets,
|
|
|
|
absolute_offsets,
|
|
|
|
outputs);
|
|
|
|
outputs);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -6575,8 +6630,11 @@ construct_tx_context(transaction tx, uint16_t with_ring_signatures = 0)
|
|
|
|
|
|
|
|
|
|
|
|
if (core_storage->get_db().tx_exists(txd.hash, tx_index))
|
|
|
|
if (core_storage->get_db().tx_exists(txd.hash, tx_index))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
out_amount_indices = core_storage->get_db()
|
|
|
|
//out_amount_indices = core_storage->get_db()
|
|
|
|
.get_tx_amount_output_indices(tx_index);
|
|
|
|
//.get_tx_amount_output_indices(tx_index).front();
|
|
|
|
|
|
|
|
get_tx_amount_output_indices<BlockchainDB>(
|
|
|
|
|
|
|
|
out_amount_indices,
|
|
|
|
|
|
|
|
tx_index);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -7080,9 +7138,45 @@ add_js_files(mstch::map& context)
|
|
|
|
}};
|
|
|
|
}};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
template <typename T, typename... Args>
|
|
|
|
|
|
|
|
typename std::enable_if<
|
|
|
|
|
|
|
|
HasSpanInGetOutputKeyT<T>::value, void>::type
|
|
|
|
|
|
|
|
get_output_key(uint64_t amount, Args&&... args)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
core_storage->get_db().get_output_key(
|
|
|
|
|
|
|
|
epee::span<const uint64_t>(&amount, 1),
|
|
|
|
|
|
|
|
std::forward<Args>(args)...);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T, typename... Args>
|
|
|
|
|
|
|
|
typename std::enable_if<
|
|
|
|
|
|
|
|
!HasSpanInGetOutputKeyT<T>::value, void>::type
|
|
|
|
|
|
|
|
get_output_key(uint64_t amount, Args&&... args)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
core_storage->get_db().get_output_key(
|
|
|
|
|
|
|
|
amount, std::forward<Args>(args)...);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T, typename... Args>
|
|
|
|
|
|
|
|
typename std::enable_if<
|
|
|
|
|
|
|
|
!OutputIndicesReturnVectOfVectT<T>::value, void>::type
|
|
|
|
|
|
|
|
get_tx_amount_output_indices(vector<uint64_t>& out_amount_indices, Args&&... args)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
out_amount_indices = core_storage->get_db()
|
|
|
|
|
|
|
|
.get_tx_amount_output_indices(std::forward<Args>(args)...);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T, typename... Args>
|
|
|
|
|
|
|
|
typename std::enable_if<
|
|
|
|
|
|
|
|
OutputIndicesReturnVectOfVectT<T>::value, void>::type
|
|
|
|
|
|
|
|
get_tx_amount_output_indices(vector<uint64_t>& out_amount_indices, Args&&... args)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
out_amount_indices = core_storage->get_db()
|
|
|
|
|
|
|
|
.get_tx_amount_output_indices(std::forward<Args>(args)...).front();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif //CROWXMR_PAGE_H
|
|
|
|
#endif //CROWXMR_PAGE_H
|
|
|
|
|
|
|
|
|
|
|
|