1
0
Fork 0
forked from lthn/blockchain

Merge branch 'cryptoassets' into C++17

This commit is contained in:
sowle 2023-07-14 13:34:13 +02:00
commit bddfaae9af
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
3 changed files with 6 additions and 5 deletions

View file

@ -105,7 +105,7 @@ namespace currency
uint64_t get_daemon_blockchain_height(std::string& err);
bool try_connect_to_daemon();
std::string get_tocken_info_string(const crypto::public_key& asset_id, uint64_t& decimal_point);
bool simple_wallet::print_wti(const tools::wallet_public::wallet_transfer_info& wti);
bool print_wti(const tools::wallet_public::wallet_transfer_info& wti);
//----------------- i_wallet2_callback ---------------------
virtual void on_new_block(uint64_t height, const currency::block& block) override;

View file

@ -36,7 +36,7 @@ public:
std::vector<tx_destination_entry> destinations;
destinations.push_back(tx_destination_entry(this->m_source_amount, m_alice.get_keys().account_address));
if (!construct_tx(this->m_miners[this->real_source_idx].get_keys(), this->m_sources, destinations, m_tx, 0))
if (!construct_tx(this->m_miners[this->real_source_idx].get_keys(), this->m_sources, destinations, std::vector<currency::attachment_v>(), m_tx, 0, 0))
return false;
get_transaction_prefix_hash(m_tx, m_tx_prefix_hash);
@ -47,7 +47,7 @@ public:
bool test()
{
const currency::txin_to_key& txin = boost::get<currency::txin_to_key>(m_tx.vin[0]);
return crypto::check_ring_signature(m_tx_prefix_hash, txin.k_image, this->m_public_key_ptrs, ring_size, boost::get<NLSAG_sig>(m_tx.signatures[0]).s.data());
return crypto::check_ring_signature(m_tx_prefix_hash, txin.k_image, this->m_public_key_ptrs, ring_size, boost::get<currency::NLSAG_sig>(m_tx.signatures[0]).s.data());
}
private:

View file

@ -29,11 +29,12 @@ public:
{
m_miners[i].generate();
if (!construct_miner_tx(0, 0, 0, 2, 0, m_miners[i].get_keys().m_account_address, m_miner_txs[i], TRANSACTION_VERSION_PRE_HF4))
uint64_t block_reward_without_fee = 0;
if (!construct_miner_tx(0, 0, 0, 2, 0, m_miners[i].get_public_address(), m_miners[i].get_public_address(), m_miner_txs[i], block_reward_without_fee, TRANSACTION_VERSION_PRE_HF4))
return false;
txout_to_key tx_out = boost::get<txout_to_key>(boost::get<tx_out_bare>(m_miner_txs[i].vout[0]).target);
output_entries.push_back(make_serializable_pair<txout_ref_v, crypto::public_key>(i, tx_out.key));
output_entries.emplace_back(i, tx_out.key);
m_public_keys[i] = tx_out.key;
m_public_key_ptrs[i] = &m_public_keys[i];
}