mirror of
https://git.wownero.com/wownero/onion-wownero-blockchain-explorer.git
synced 2024-08-15 00:33:12 +00:00
reconstruction of mainnet txs from json is good now.
This commit is contained in:
parent
13f2505f88
commit
6141f92311
3 changed files with 109 additions and 44 deletions
16
src/page.h
16
src/page.h
|
@ -480,14 +480,14 @@ public:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// @TODO need to make this tx from _tx_info.tx_json
|
// // @TODO need to make this tx from _tx_info.tx_json
|
||||||
transaction tx;
|
// transaction tx;
|
||||||
|
//
|
||||||
if (!xmreg::make_tx_from_json(string{}, tx))
|
// if (!xmreg::make_tx_from_json(string{}, tx))
|
||||||
{
|
// {
|
||||||
cerr << "Cant make tx from _tx_info.tx_json" << endl;
|
// cerr << "Cant make tx from _tx_info.tx_json" << endl;
|
||||||
return string {"Cant make tx from _tx_info.tx_json"};
|
// //return string {"Cant make tx from _tx_info.tx_json"};
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
// number of last blocks to show
|
// number of last blocks to show
|
||||||
|
|
114
src/tools.cpp
114
src/tools.cpp
File diff suppressed because one or more lines are too long
23
src/tools.h
23
src/tools.h
|
@ -275,6 +275,29 @@ get_real_output_for_key_image(const key_image& ki,
|
||||||
uint64_t output_idx,
|
uint64_t output_idx,
|
||||||
public_key output_pub_key);
|
public_key output_pub_key);
|
||||||
|
|
||||||
|
// based on http://stackoverflow.com/a/9943098/248823
|
||||||
|
template<typename Iterator, typename Func>
|
||||||
|
void chunks(Iterator begin,
|
||||||
|
Iterator end,
|
||||||
|
iterator_traits<string::iterator>::difference_type k,
|
||||||
|
Func f)
|
||||||
|
{
|
||||||
|
Iterator chunk_begin;
|
||||||
|
Iterator chunk_end;
|
||||||
|
chunk_end = chunk_begin = begin;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if(std::distance(chunk_end, end) < k)
|
||||||
|
chunk_end = end;
|
||||||
|
else
|
||||||
|
std::advance(chunk_end, k);
|
||||||
|
f(chunk_begin,chunk_end);
|
||||||
|
chunk_begin = chunk_end;
|
||||||
|
}
|
||||||
|
while(std::distance(chunk_begin,end) > 0);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
make_tx_from_json(const string& json_str, transaction& tx);
|
make_tx_from_json(const string& json_str, transaction& tx);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue