for_all_outputs removed

This commit is contained in:
moneroexamples 2016-05-15 10:36:41 +00:00
parent 036e7bbbb6
commit d6c2e8fc49
2 changed files with 1 additions and 65 deletions

View File

@ -1375,70 +1375,6 @@ namespace xmreg {
return mstch::render(full_page, context);
}
void find_all_outputs()
{
string xmr_address_str {"43A7NUmo5HbhJoSKbw9bRWW4u2b8dNfhKheTR5zxoRwQ7bULK5TgUQeAvPS5EVNLAJYZRQYqXCmhdf26zG2Has35SpiF1FP"};
string viewkey_str {"9c2edec7636da3fbb343931d6c3d6e11bcd8042ff7e11de98a8d364f31976c04"};
// parse string representing given monero address
cryptonote::account_public_address address;
if (!xmreg::parse_str_address(xmr_address_str, address, 0))
{
cerr << "Cant parse string address: " << xmr_address_str << endl;
//return string("Cant parse xmr address: " + xmr_address_str);
}
// parse string representing given private viewkey
crypto::secret_key prv_view_key;
if (!xmreg::parse_str_secret_key(viewkey_str, prv_view_key))
{
cerr << "Cant parse view key: " << viewkey_str << endl;
//return string("Cant parse view key: " + viewkey_str);
}
// public transaction key is combined with our viewkey
// to create, so called, derived key.
// key_derivation derivation;
//
// if (!generate_key_derivation(txd.pk, prv_view_key, derivation))
// {
// cerr << "Cant get dervied key for: " << "\n"
// << "pub_tx_key: " << txd.pk << " and "
// << "prv_view_key" << prv_view_key << endl;
//
// //return string("Cant get key_derivation");
// }
public_key to_find;
epee::string_tools::hex_to_pod(
"46ff0a46390feab13e1991186d622b768069c8489ed27e62fca4d478aaee3ffc",
to_find);
auto output_search = [&](public_key& output_pub_key,
uint64_t& amount) -> bool
{
if (to_find == output_pub_key)
{
cout << amount << endl;
}
return true;
};
//@TODO make lmdb2 path to some option
xmreg::MyLMDB mylmdb {"/home/mwo/.bitmonero/lmdb2"};
cout << "Seaerch stated" << endl;
mylmdb.for_all_output_amounts(output_search);
cout << "Seaerch finished" << endl;
}
string
search(string search_text)
{

View File

@ -26,12 +26,12 @@
<table class="center" style="width: 80%; margin-top:10px">
<tr>
<td>Block: <a href="/block/{{blk_height}}">{{blk_height}}</a></td>
<td>Timestamp: {{blk_timestamp_uint}}</td>
<td>Timestamp [UCT]: {{blk_timestamp}}</td>
<td>Age [y:d:h:m:s]: {{delta_time}}</td>
</tr>
<tr>
<td>Block: <a href="/block/{{blk_height}}">{{blk_height}}</a></td>
<td>Fee: {{tx_fee}}</td>
<td>Tx size: {{tx_size}} kB</td>
</tr>