63 while (null_hash != curr && blockchain.size() < n)
65 auto it = m_blocks_info.find(curr);
66 if (m_blocks_info.end() == it)
68 throw std::runtime_error(
"block hash wasn't found");
71 blockchain.push_back(it->second);
72 curr = it->second.prev_id;
75 std::reverse(blockchain.begin(), blockchain.end());
80 std::vector<block_info> blockchain;
81 get_block_chain(blockchain,
head, n);
82 BOOST_FOREACH(
auto& bi, blockchain)
84 block_weights.push_back(bi.block_weight);
90 auto it = m_blocks_info.find(blk_id);
91 if (it == m_blocks_info.end())
92 throw std::runtime_error(
"block hash wasn't found");
94 return it->second.already_generated_coins;
101 return get_already_generated_coins(blk_hash);
114 std::vector<size_t>& block_weights,
const std::list<cryptonote::transaction>& tx_list,
115 const boost::optional<uint8_t>& hf_ver)
131 size_t txs_weight = 0;
132 BOOST_FOREACH(
auto& tx, tx_list)
149 if (target_block_weight < actual_block_weight)
151 target_block_weight = actual_block_weight;
153 else if (actual_block_weight < target_block_weight)
155 size_t delta = target_block_weight - actual_block_weight;
158 if (actual_block_weight == target_block_weight)
164 CHECK_AND_ASSERT_MES(target_block_weight < actual_block_weight,
false,
"Unexpected block size");
165 delta = actual_block_weight - target_block_weight;
168 if (actual_block_weight == target_block_weight)
174 CHECK_AND_ASSERT_MES(actual_block_weight < target_block_weight,
false,
"Unexpected block size");
193 add_block(blk, txs_weight, block_weights, already_generated_coins, hf_ver ? hf_ver.get() : 1);
200 std::vector<size_t> block_weights;
201 std::list<cryptonote::transaction> tx_list;
202 return construct_block(blk, 0, null_hash, miner_acc, timestamp, 0, block_weights, tx_list);
207 const std::list<cryptonote::transaction>& tx_list,
208 const boost::optional<uint8_t>& hf_ver)
214 uint64_t already_generated_coins = get_already_generated_coins(prev_id);
215 std::vector<size_t> block_weights;
218 return construct_block(blk,
height, prev_id, miner_acc, timestamp, already_generated_coins, block_weights, tx_list, hf_ver);
222 int actual_params,
uint8_t major_ver,
226 const std::vector<crypto::hash>& tx_hashes,
227 size_t txs_weight,
size_t max_outs,
uint8_t hf_version)
233 blk.
tx_hashes = actual_params & bf_tx_hashes ? tx_hashes : std::vector<crypto::hash>();
234 max_outs = actual_params & bf_max_outs ? max_outs : 9999;
235 hf_version = actual_params & bf_hf_version ? hf_version : 1;
238 uint64_t already_generated_coins = get_already_generated_coins(prev_block);
239 std::vector<size_t> block_weights;
241 if (actual_params & bf_miner_tx)
258 add_block(blk, txs_weight, block_weights, already_generated_coins, hf_version);
265 const std::vector<crypto::hash>& tx_hashes,
size_t txs_weight)
267 return construct_block_manually(blk, prev_block, miner_acc, bf_tx_hashes, 0, 0, 0,
crypto::hash(), 0,
transaction(), tx_hashes, txs_weight);
272 uint64_t get_inputs_amount(
const vector<tx_source_entry> &s)
286 BOOST_FOREACH (
const block& blk, blockchain) {
287 vector<const transaction*> vtx;
291 const map_hash2tx_t::const_iterator cit = mtx.find(h);
292 if (mtx.end() == cit)
293 throw std::runtime_error(
"block contains an unknown tx hash");
295 vtx.push_back(cit->second);
300 for (
size_t i = 0; i < vtx.size(); i++) {
303 for (
size_t j = 0; j < tx.
vout.size(); ++j) {
311 if (2 == out.target.which()) {
312 outs[out.amount].push_back(oi);
313 size_t tx_global_idx = outs[out.amount].size() - 1;
314 outs[out.amount][tx_global_idx].idx = tx_global_idx;
317 outs_mine[out.amount].push_back(tx_global_idx);
329 BOOST_FOREACH (
const map_output_t::value_type &o, outs_mine) {
330 for (
size_t i = 0; i < o.second.size(); ++i) {
337 std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
342 BOOST_FOREACH(
auto& tx_pair, mtx) {
344 BOOST_FOREACH(
const txin_v &in, tx.
vin) {
346 const txin_to_key &itk = boost::get<txin_to_key>(in);
359 bool fill_output_entries(std::vector<output_index>& out_indices,
size_t sender_out,
size_t nmix,
size_t& real_entry_idx, std::vector<tx_source_entry::output_entry>& output_entries)
361 if (out_indices.size() <= nmix)
364 bool sender_out_found =
false;
366 for (
size_t i = 0; i < out_indices.size() && (0 < rest || !sender_out_found); ++i)
376 sender_out_found =
true;
377 real_entry_idx = output_entries.size();
393 return 0 == rest && sender_out_found;
396 bool fill_tx_sources(std::vector<tx_source_entry>& sources,
const std::vector<test_event_entry>& events,
402 std::vector<cryptonote::block> blockchain;
415 bool sources_found =
false;
416 BOOST_REVERSE_FOREACH(
const map_output_t::value_type o, outs_mine)
418 for (
size_t i = 0; i < o.second.size() && !sources_found; ++i)
420 size_t sender_out = o.second[i];
441 ot.second.mask = comm;
443 sources.push_back(ts);
445 sources_amount += ts.
amount;
446 sources_found = amount <= sources_amount;
453 return sources_found;
464 return find_out(std::make_pair(txid, out));
469 return m_map_outs.find(
id);
474 std::vector<const cryptonote::block*> blks;
475 blks.reserve(blockchain.size());
477 BOOST_FOREACH (
const block& blk, blockchain) {
479 auto it = m_blocks.find(hsh);
480 if (it == m_blocks.end()){
484 blks.push_back(&m_blocks[hsh]);
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++) {
503 process(blk, vtx[i], i);
510 for (
size_t j = 0; j < tx->
vout.size(); ++j) {
519 auto it = find_out(hid);
520 if (it != m_map_outs.end()){
526 oi.
idx = m_outs[rct_amount].size();
530 m_outs[rct_amount].push_back(oi);
531 m_map_outs.insert({hid, oi});
539 for(
size_t j=0; j < tx->
vout.size(); ++j){
540 auto it = find_out(tx->
hash, j);
541 if (it != m_map_outs.end()){
542 indices.push_back(it->second.idx);
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);
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)
623 for(
auto & in : tx.
vin){
625 auto tk = boost::get<txin_to_key>(in);
626 std::vector<uint64_t> full_off;
629 ss <<
" i: " << tk.amount <<
" [";
630 for(
auto ix : tk.key_offsets){
634 full_off.push_back(ix);
642 for(
auto ix : full_off){
647 }
else if (
typeid(
txin_gen) == in.type()){
648 ss <<
" h: " << boost::get<txin_gen>(in).
height <<
", ";
654 ss <<
", mixring: \n";
657 ss <<
" (" <<
dump_keys(cur.dest.bytes) <<
", " <<
dump_keys(cur.mask.bytes) <<
")\n ";
668 return boost::get<cryptonote::account_public_address>(
inp);
670 return boost::get<cryptonote::account_keys>(
inp).m_account_address;
672 return boost::get<cryptonote::account_base>(
inp).get_keys().m_account_address;
674 return boost::get<cryptonote::tx_destination_entry>(
inp).addr;
676 throw std::runtime_error(
"Unexpected type");
687 return inp.m_account_address;
692 return inp.get_keys().m_account_address;
703 for(
auto & cur : destinations){
704 amount += cur.amount;
713 for(
auto & cur : sources){
714 amount += cur.amount;
722 const std::vector<tx_source_entry> &sources,
723 std::vector<tx_destination_entry>& destinations,
727 destinations.clear();
729 std::copy(dests.begin(), dests.end(), std::back_inserter(destinations));
732 uint64_t cache_back = get_inputs_amount(sources) - (amount + fee);
734 if (cache_back > 0 || always_change) {
736 throw std::runtime_error(
"couldn't fill transaction cache back destination");
737 destinations.push_back(de_change);
743 const std::vector<tx_source_entry> &sources,
744 std::vector<tx_destination_entry>& destinations,
745 std::vector<tx_destination_entry>& destinations_pure,
748 destinations.clear();
752 throw std::runtime_error(
"couldn't fill transaction destination");
753 destinations.push_back(de);
754 destinations_pure.push_back(de);
757 uint64_t cache_back = get_inputs_amount(sources) - (amount + fee);
759 if (cache_back > 0 || always_change) {
761 throw std::runtime_error(
"couldn't fill transaction cache back destination");
762 destinations.push_back(de_change);
768 const std::vector<tx_source_entry> &sources,
769 std::vector<tx_destination_entry>& destinations,
bool always_change)
771 std::vector<tx_destination_entry> destinations_pure;
772 fill_tx_destinations(from, to, amount, fee, sources, destinations, destinations_pure, always_change);
777 uint64_t amount,
uint64_t fee,
size_t nmix, std::vector<tx_source_entry>& sources,
778 std::vector<tx_destination_entry>& destinations)
781 destinations.clear();
783 if (!
fill_tx_sources(sources, events, blk_head, from, amount + fee, nmix))
784 throw std::runtime_error(
"couldn't fill transaction sources");
791 uint64_t amount,
uint64_t fee,
size_t nmix, std::vector<tx_source_entry>& sources,
792 std::vector<tx_destination_entry>& destinations)
800 while (!miner::find_nonce_for_given_block(blk, diffic,
height))
815 std::vector<cryptonote::tx_destination_entry>
res;
820 std::vector<cryptonote::tx_destination_entry>
build_dsts(std::initializer_list<dest_wrapper_t> inps)
822 std::vector<cryptonote::tx_destination_entry>
res;
823 res.reserve(inps.size());
824 for(
auto & c : inps){
825 res.push_back(
build_dst(c.addr, c.is_subaddr, c.amount));
843 tx.
vin.push_back(in);
848 if (
height == 1){block_reward = 1260000000000;}
862 out.amount = block_reward;
864 tx.
vout.push_back(out);
876 vector<tx_source_entry> sources;
877 vector<tx_destination_entry> destinations;
887 vector<tx_source_entry> sources;
888 vector<tx_destination_entry> destinations_all;
891 if (!
fill_tx_sources(sources, events, blk_head, from, amount + fee, nmix))
892 throw std::runtime_error(
"couldn't fill transaction sources");
901 std::vector<cryptonote::tx_source_entry> &sources,
904 vector<tx_destination_entry> destinations;
911 const std::vector<cryptonote::tx_destination_entry>& destinations,
912 std::vector<cryptonote::tx_source_entry> &sources,
915 vector<tx_destination_entry> all_destinations;
922 std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
925 std::vector<crypto::secret_key> additional_tx_keys;
926 std::vector<tx_destination_entry> destinations_copy = destinations;
928 return construct_tx_and_get_tx_key(sender_account_keys, subaddresses, sources, destinations_copy, change_addr, extra, tx, unlock_time, tx_key, additional_tx_keys,
rct, rct_config,
nullptr);
936 events.push_back(tx);
942 std::map<uint64_t, std::vector<output_index> > outs;
943 std::map<uint64_t, std::vector<size_t> > outs_mine;
954 BOOST_FOREACH (
const map_output_t::value_type &o, outs_mine) {
955 for (
size_t i = 0; i < o.second.size(); ++i) {
956 if (outs[o.first][o.second[i]].spent)
959 res += outs[o.first][o.second[i]].amount;
968 for(
auto & ev : events)
972 const auto & rep_settings = boost::get<event_replay_settings>(ev);
973 if (rep_settings.hard_forks)
975 const auto & hf = rep_settings.hard_forks.get();
976 std::copy(hf.begin(), hf.end(), std::back_inserter(hard_forks));
981 return !hard_forks.empty();
986 std::unordered_set<crypto::hash> confirmed_hashes;
987 BOOST_FOREACH(
const block& blk, blockchain)
991 confirmed_hashes.insert(tx_hash);
995 BOOST_FOREACH(
const auto& tx_pair, mtx)
997 if (0 != confirmed_hashes.count(tx_pair.first))
999 confirmed_txs.insert(tx_pair);
1008 for(
size_t i = 0; i < blockchain.size(); ++i){
1017 if (found && cut > 0){
1018 blockchain.erase(blockchain.begin(), blockchain.begin() + cut);
1028 for(
size_t i = 0; i < blockchain.size(); ++i){
1037 if (found && cut > 0){
1038 blockchain.erase(blockchain.begin(), blockchain.begin() + cut);
1049 if (
typeid(
block) == ev.type())
1060 for(
auto it = events.rbegin(); it != events.rend(); ++it)
1063 if (
typeid(
block) == ev.type())
1065 return boost::get<block>(ev);
1069 throw std::runtime_error(
"No block event");
1073 std::unordered_map<crypto::hash, const block*> block_index;
1076 if (
typeid(
block) == ev.type())
1078 const block* blk = &boost::get<block>(ev);
1083 const transaction& tx = boost::get<transaction>(ev);
1088 bool b_success =
false;
1090 for (
auto it = block_index.find(
id); block_index.end() != it; it = block_index.find(
id))
1092 blockchain.push_back(*it->second);
1093 id = it->second->prev_id;
1094 if (null_hash ==
id)
1100 reverse(blockchain.begin(), blockchain.end());
1106 std::unordered_map<crypto::hash, const block*> block_index;
1109 if (
typeid(
block) == ev.type())
1111 const block* blk = &boost::get<block>(ev);
1116 const transaction& tx = boost::get<transaction>(ev);
1121 bool b_success =
false;
1123 for (
auto it = block_index.find(
id); block_index.end() != it; it = block_index.find(
id))
1125 blockchain.push_back(it->second);
1126 id = it->second->prev_id;
1127 if (null_hash ==
id)
1133 reverse(blockchain.begin(), blockchain.end());
1140 m_callbacks[cb_name] = cb;
1144 auto cb_it = m_callbacks.find(cb_name);
1145 if(cb_it == m_callbacks.end())
1147 LOG_ERROR(
"Failed to find callback " << cb_name);
1150 return cb_it->second(c, ev_index, events);
1166 if (tvc.m_verification_failed)
std::map< uint64_t, std::vector< output_index > > map_output_idx_t
#define CRYPTONOTE_MINED_ETN_UNLOCK_WINDOW
#define CHECK_AND_ASSERT_THROW_MES(expr, message)
bool construct_miner_tx_manually(size_t height, uint64_t already_generated_coins, const account_public_address &miner_address, transaction &tx, uint64_t fee, keypair *p_txkey)
std::vector< crypto::hash > tx_hashes
bool get_tx_fee(const transaction &tx, uint64_t &fee)
crypto::public_key real_out_tx_key
void global_indices(const cryptonote::transaction *tx, std::vector< uint64_t > &indices)
bool extract_hard_forks(const std::vector< test_event_entry > &events, v_hardforks_t &hard_forks)
bool check_tx_verification_context(const cryptonote::tx_verification_context &tvc, bool, size_t, const cryptonote::transaction &)
bool check_block_verification_context(const cryptonote::block_verification_context &bvc, size_t event_idx, const cryptonote::block &)
uint64_t current_difficulty_window(const boost::optional< uint8_t > &hf_ver=boost::none)
bool init_output_indices(map_output_idx_t &outs, std::map< uint64_t, std::vector< size_t > > &outs_mine, const std::vector< cryptonote::block > &blockchain, const map_hash2tx_t &mtx, const cryptonote::account_base &from)
bool fill_tx_sources(std::vector< tx_source_entry > &sources, const std::vector< test_event_entry > &events, const block &blk_head, const cryptonote::account_base &from, uint64_t amount, size_t nmix)
bool m_verification_failed
bool find_block_chain(const std::vector< test_event_entry > &events, std::vector< cryptonote::block > &blockchain, map_hash2tx_t &mtx, const crypto::hash &head)
#define CHECK_AND_ASSERT_MES(expr, fail_ret_val, message)
const cryptonote::txout_target_v out
boost::variant< txin_gen, txin_to_script, txin_to_scripthash, txin_to_key, txin_to_key_public > txin_v
bool init_spent_output_indices(map_output_idx_t &outs, map_output_t &outs_mine, const std::vector< cryptonote::block > &blockchain, const map_hash2tx_t &mtx, const cryptonote::account_base &from)
std::vector< cryptonote::tx_destination_entry > build_dsts(const var_addr_t &to1, bool sub1, uint64_t am1)
uint64_t sum_amount(const std::vector< tx_destination_entry > &destinations)
std::map< uint64_t, std::vector< size_t > > map_output_t
uint64_t num_blocks(const std::vector< test_event_entry > &events)
void fill_tx_sources_and_destinations(const std::vector< test_event_entry > &events, const block &blk_head, const cryptonote::account_base &from, const cryptonote::account_public_address &to, uint64_t amount, uint64_t fee, size_t nmix, std::vector< tx_source_entry > &sources, std::vector< tx_destination_entry > &destinations)
bool construct_tx_rct(const cryptonote::account_keys &sender_account_keys, std::vector< cryptonote::tx_source_entry > &sources, const std::vector< cryptonote::tx_destination_entry > &destinations, const boost::optional< cryptonote::account_public_address > &change_addr, std::vector< uint8_t > extra, cryptonote::transaction &tx, uint64_t unlock_time, bool rct, rct::RangeProofType range_proof_type, int bp_version)
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)
boost::function< bool(cryptonote::core &c, size_t ev_index, const std::vector< test_event_entry > &events)> verify_callback
uint64_t get_balance(const cryptonote::account_base &addr, const std::vector< cryptonote::block > &blockchain, const map_hash2tx_t &mtx)
boost::variant< cryptonote::account_public_address, cryptonote::account_keys, cryptonote::account_base, cryptonote::tx_destination_entry > var_addr_t
uint64_t get_transaction_weight(const transaction &tx, size_t blob_size)
boost::variant< cryptonote::block, cryptonote::transaction, std::vector< cryptonote::transaction >, cryptonote::account_base, callback_entry, serialized_block, serialized_transaction, event_visitor_settings, event_replay_settings > test_event_entry
cryptonote::tx_destination_entry build_dst(const var_addr_t &to, bool is_subaddr, uint64_t amount)
bool check_tx_verification_context_array(const std::vector< cryptonote::tx_verification_context > &tvcs, size_t, size_t, const std::vector< cryptonote::transaction > &)
transaction construct_tx_with_fee(std::vector< test_event_entry > &events, const block &blk_head, const account_base &acc_from, const var_addr_t &to, uint64_t amount, uint64_t fee)
void get_confirmed_txs(const std::vector< cryptonote::block > &blockchain, const map_hash2tx_t &mtx, map_hash2tx_t &confirmed_txs)
void copy(key &AA, const key &A)
bool generate_key_derivation(const public_key &key1, const secret_key &key2, key_derivation &derivation)
map_txid_output_t::iterator find_out(const crypto::hash &txid, size_t out)
std::vector< uint8_t > extra
bool fill_tx_destination(tx_destination_entry &de, const cryptonote::account_public_address &to, uint64_t amount)
const account_keys & get_keys() const
std::vector< tx_out > vout
Holds cryptonote related classes and helpers.
bool trim_block_chain(std::vector< cryptonote::block > &blockchain, const crypto::hash &tail)
std::vector< txin_v > vin
crypto::public_key m_spend_public_key
bool construct_block_manually(cryptonote::block &blk, const cryptonote::block &prev_block, const cryptonote::account_base &miner_acc, int actual_params=bf_none, uint8_t major_ver=0, uint8_t minor_ver=0, uint64_t timestamp=0, const crypto::hash &prev_id=crypto::hash(), const cryptonote::difficulty_type &diffic=1, const cryptonote::transaction &miner_tx=cryptonote::transaction(), const std::vector< crypto::hash > &tx_hashes=std::vector< crypto::hash >(), size_t txs_sizes=0, size_t max_outs=999, uint8_t hf_version=1)
bool construct_tx_to_key(const std::vector< test_event_entry > &events, cryptonote::transaction &tx, const cryptonote::block &blk_head, const cryptonote::account_base &from, const var_addr_t &to, uint64_t amount, uint64_t fee, size_t nmix, bool rct, rct::RangeProofType range_proof_type, int bp_version)
bool add_tx_pub_key_to_extra(transaction &tx, const crypto::public_key &tx_pub_key)
std::unordered_map< crypto::hash, const cryptonote::transaction * > map_hash2tx_t
crypto::public_key m_view_public_key
rct::rctSig rct_signatures
bool construct_block_manually_tx(cryptonote::block &blk, const cryptonote::block &prev_block, const cryptonote::account_base &miner_acc, const std::vector< crypto::hash > &tx_hashes, size_t txs_size)
bool generate_key_image_helper(const account_keys &ack, const std::unordered_map< crypto::public_key, subaddress_index > &subaddresses, const crypto::public_key &out_key, const crypto::public_key &tx_public_key, const std::vector< crypto::public_key > &additional_tx_public_keys, size_t real_output_index, keypair &in_ephemeral, crypto::key_image &ki, hw::device &hwdev, const uint32_t account_major_offset)
const cryptonote::transaction * p_tx
void fill_tx_destinations(const var_addr_t &from, const std::vector< tx_destination_entry > &dests, uint64_t fee, const std::vector< tx_source_entry > &sources, std::vector< tx_destination_entry > &destinations, bool always_change)
device & get_device(const std::string &device_descriptor)
handles core cryptonote functionality
unsigned __int64 uint64_t
std::string dump_data(const cryptonote::transaction &tx)
crypto::public_key get_tx_pub_key_from_extra(const std::vector< uint8_t > &tx_extra, size_t pk_index)
cryptonote::account_public_address get_address(const var_addr_t &inp)
account_public_address addr
void register_callback(const std::string &cb_name, verify_callback cb)
type_vec_type median(std::vector< type_vec_type > &v)
#define CRYPTONOTE_REWARD_BLOCKS_WINDOW
account_public_address m_account_address
bool is_out_to_acc(const account_keys &acc, const txout_to_key &out_key, const crypto::public_key &tx_pub_key, const std::vector< crypto::public_key > &additional_tx_pub_keys, size_t output_index)
std::pair< crypto::hash, size_t > output_hasher
boost::multiprecision::uint128_t difficulty_type
void add_block(const cryptonote::block &blk, size_t tsx_size, std::vector< size_t > &block_weights, uint64_t already_generated_coins, uint8_t hf_version=1)
bool construct_block(cryptonote::block &blk, uint64_t height, const crypto::hash &prev_id, const cryptonote::account_base &miner_acc, uint64_t timestamp, uint64_t already_generated_coins, std::vector< size_t > &block_weights, const std::list< cryptonote::transaction > &tx_list, const boost::optional< uint8_t > &hf_ver=boost::none)
void fill_nonce(cryptonote::block &blk, const difficulty_type &diffic, uint64_t height)
size_t real_output_in_tx_index
bool derive_public_key(const key_derivation &derivation, std::size_t output_index, const public_key &base, public_key &derived_key)
bool fill_output_entries(std::vector< output_index > &out_indices, size_t sender_out, size_t nmix, size_t &real_entry_idx, std::vector< tx_source_entry::output_entry > &output_entries)
bool verify(const std::string &cb_name, cryptonote::core &c, size_t ev_index, const std::vector< test_event_entry > &events)
crypto::key_image k_image
crypto::hash get_transaction_hash(const transaction &t)
uint64_t get_already_generated_coins(const crypto::hash &blk_id) const
void process(const std::vector< cryptonote::block > &blockchain, const map_hash2tx_t &mtx)
std::vector< output_entry > outputs
#define CURRENT_BLOCK_MINOR_VERSION
key zeroCommit(etn_amount amount)
crypto::hash get_block_hash(uint64_t height)
cryptonote::difficulty_type get_test_difficulty(const boost::optional< uint8_t > &hf_ver=boost::none)
#define DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN
bool get_block_reward(size_t median_weight, size_t current_block_weight, uint64_t already_generated_coins, uint64_t &reward, uint8_t version, uint64_t current_block_height, network_type nettype)
bool construct_miner_tx(size_t height, size_t median_weight, uint64_t already_generated_coins, size_t current_block_weight, uint64_t fee, const account_public_address &miner_address, transaction &tx, const blobdata &extra_nonce, size_t max_outs, uint8_t hard_fork_version, network_type nettype)
std::pair< uint64_t, rct::ctkey > output_entry
std::vector< crypto::public_key > get_additional_tx_pub_keys_from_extra(const std::vector< uint8_t > &tx_extra)
std::string dump_keys(T *buff32)
cryptonote::block get_head_block(const std::vector< test_event_entry > &events)
bool construct_tx_and_get_tx_key(const account_keys &sender_account_keys, const std::unordered_map< crypto::public_key, subaddress_index > &subaddresses, std::vector< tx_source_entry > &sources, std::vector< tx_destination_entry > &destinations, const boost::optional< cryptonote::account_public_address > &change_addr, const std::vector< uint8_t > &extra, transaction &tx, uint64_t unlock_time, crypto::secret_key &tx_key, std::vector< crypto::secret_key > &additional_tx_keys, bool rct, const rct::RCTConfig &rct_config, rct::multisig_out *msout, const uint32_t account_major_offset, const cryptonote::network_type nettype)
bool m_verification_failed
void get_last_n_block_weights(std::vector< size_t > &block_weights, const crypto::hash &head, size_t n) const
uint64_t get_block_height(const block &b)
void get_block_chain(std::vector< block_info > &blockchain, const crypto::hash &head, size_t n) const
std::vector< std::pair< uint8_t, uint64_t > > v_hardforks_t
#define CURRENT_BLOCK_MAJOR_VERSION
rct::key commitment() const