#include <chaingen.h>
|
| | block_tracker ()=default |
| |
| | block_tracker (const block_tracker &bt) |
| |
| map_txid_output_t::iterator | find_out (const crypto::hash &txid, size_t out) |
| |
| map_txid_output_t::iterator | find_out (const output_hasher &id) |
| |
| void | process (const std::vector< cryptonote::block > &blockchain, const map_hash2tx_t &mtx) |
| |
| void | process (const std::vector< const cryptonote::block *> &blockchain, const map_hash2tx_t &mtx) |
| |
| void | process (const cryptonote::block *blk, const cryptonote::transaction *tx, size_t i) |
| |
| void | global_indices (const cryptonote::transaction *tx, std::vector< uint64_t > &indices) |
| |
| void | get_fake_outs (size_t num_outs, uint64_t amount, uint64_t global_index, uint64_t cur_height, std::vector< get_outs_entry > &outs) |
| |
| std::string | dump_data () |
| |
| void | dump_data (const std::string &fname) |
| |
Definition at line 370 of file chaingen.h.
◆ block_tracker() [1/2]
| block_tracker::block_tracker |
( |
| ) |
|
|
default |
◆ block_tracker() [2/2]
Definition at line 378 of file chaingen.h.
map_txid_output_t m_map_outs
◆ dump_data() [1/2]
| std::string block_tracker::dump_data |
( |
| ) |
|
Definition at line 584 of file chaingen.cpp.
587 for (
auto &m_out :
m_outs)
589 auto & vct = m_out.second;
590 ss << m_out.first <<
" => |vector| = " << vct.size() <<
'\n';
592 for (
const auto & oi : vct)
594 auto out = boost::get<txout_to_key>(oi.out);
596 ss <<
" idx: " << oi.idx
597 <<
", rct: " << oi.rct
598 <<
", etn: " << oi.amount
601 <<
", txid: " <<
dump_keys(oi.p_tx->hash.data)
std::string dump_keys(T *buff32)
◆ dump_data() [2/2]
| void block_tracker::dump_data |
( |
const std::string & |
fname | ) |
|
◆ find_out() [1/2]
| map_txid_output_t::iterator block_tracker::find_out |
( |
const crypto::hash & |
txid, |
|
|
size_t |
out |
|
) |
| |
Definition at line 462 of file chaingen.cpp.
464 return find_out(std::make_pair(txid, out));
map_txid_output_t::iterator find_out(const crypto::hash &txid, size_t out)
◆ find_out() [2/2]
| map_txid_output_t::iterator block_tracker::find_out |
( |
const output_hasher & |
id | ) |
|
◆ get_fake_outs()
Definition at line 547 of file chaingen.cpp.
548 auto & vct =
m_outs[amount];
549 const size_t n_outs = vct.size();
551 std::set<size_t> used;
552 std::vector<size_t> choices;
553 choices.resize(n_outs);
554 for(
size_t i=0; i < n_outs; ++i) choices[i] = i;
555 shuffle(choices.begin(), choices.end(), std::default_random_engine(crypto::rand<unsigned>()));
559 outs.reserve(num_outs);
560 while(outs.size() < num_outs){
562 idx = (idx + 1) % n_outs;
563 size_t oi_idx = choices[(size_t)idx];
566 auto & oi = vct[oi_idx];
567 if (oi.idx == global_index)
571 if (oi.unlock_time > cur_height)
573 if (used.find(oi_idx) != used.end())
577 auto out = boost::get<txout_to_key>(oi.out);
579 outs.push_back(item);
#define CHECK_AND_ASSERT_THROW_MES(expr, message)
◆ global_indices()
Definition at line 535 of file chaingen.cpp.
539 for(
size_t j=0; j < tx->
vout.size(); ++j){
542 indices.push_back(it->second.idx);
map_txid_output_t::iterator find_out(const crypto::hash &txid, size_t out)
std::vector< tx_out > vout
map_txid_output_t m_map_outs
◆ process() [1/3]
Definition at line 472 of file chaingen.cpp.
474 std::vector<const cryptonote::block*> blks;
475 blks.reserve(blockchain.size());
477 BOOST_FOREACH (
const block& blk, blockchain) {
void process(const std::vector< cryptonote::block > &blockchain, const map_hash2tx_t &mtx)
crypto::hash get_block_hash(uint64_t height)
◆ process() [2/3]
Definition at line 490 of file chaingen.cpp.
492 BOOST_FOREACH (
const block* blk, blockchain) {
493 vector<const transaction*> vtx;
497 const map_hash2tx_t::const_iterator cit = mtx.find(h);
499 vtx.push_back(cit->second);
502 for (
size_t i = 0; i < vtx.size(); i++) {
#define CHECK_AND_ASSERT_THROW_MES(expr, message)
std::vector< crypto::hash > tx_hashes
void process(const std::vector< cryptonote::block > &blockchain, const map_hash2tx_t &mtx)
◆ process() [3/3]
Definition at line 508 of file chaingen.cpp.
510 for (
size_t j = 0; j < tx->
vout.size(); ++j) {
526 oi.idx =
m_outs[rct_amount].size();
530 m_outs[rct_amount].push_back(oi);
map_txid_output_t::iterator find_out(const crypto::hash &txid, size_t out)
std::vector< tx_out > vout
std::vector< txin_v > vin
unsigned __int64 uint64_t
map_txid_output_t m_map_outs
std::pair< crypto::hash, size_t > output_hasher
◆ boost::serialization::access
| friend class boost::serialization::access |
|
friend |
◆ m_blocks
◆ m_map_outs
◆ m_outs
The documentation for this class was generated from the following files:
- /home/abuild/rpmbuild/BUILD/electroneum-5.0.0.4/tests/core_tests/chaingen.h
- /home/abuild/rpmbuild/BUILD/electroneum-5.0.0.4/tests/core_tests/chaingen.cpp