1
0
Fork 0
forked from lthn/blockchain

varios fixes: is_out_burned, lookup_acc_outs, process_new_transaction, create_tx (blinding masks)

This commit is contained in:
sowle 2022-08-08 13:35:38 +02:00
parent b1ac0ad440
commit b01e33f68b
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
3 changed files with 13 additions and 13 deletions

View file

@ -1672,8 +1672,8 @@ namespace currency
size_t output_index = tx.vout.size(); // in case of append mode we need to start output indexing from the last one + 1
uint64_t range_proof_start_index = output_index;
std::set<uint16_t> deriv_cache;
crypto::scalar_vec_t blinding_masks(destinations.size()); // vector of secret blinging masks for each output. For range proof generation
crypto::scalar_vec_t amounts(destinations.size()); // vector of amounts, converted to scalars. For ranage proof generation
crypto::scalar_vec_t blinding_masks(tx.vout.size() + destinations.size()); // vector of secret blinging masks for each output. For range proof generation
crypto::scalar_vec_t amounts(tx.vout.size() + destinations.size()); // vector of amounts, converted to scalars. For ranage proof generation
crypto::scalar_t blinding_masks_sum = 0;
for(const tx_destination_entry& dst_entr : shuffled_dsts)
{
@ -2275,7 +2275,7 @@ namespace currency
VARIANT_CASE_CONST(txout_multisig, t)
if (is_out_to_acc(acc, t, derivation, output_index))
{
outs.emplace_back(output_index, 0); // TODO: @#@# consider this
outs.emplace_back(output_index, o.amount); // TODO: @#@# consider this
//don't cout this money
}
VARIANT_CASE_CONST(txout_htlc, htlc)

View file

@ -422,23 +422,22 @@ namespace currency
template<typename out_t>
inline bool is_out_burned(const out_t& out) { CHECK_AND_ASSERT_THROW_MES(false, "incorrect out type: " << typeid(out).name()); }
inline bool is_out_burned(const tx_out_bare& o) { return is_out_burned(o.target); }
template<>
inline bool is_out_burned(const txout_to_key& o) { return o.key == null_pkey; }
template<>
inline bool is_out_burned(const tx_out_zarcanum& o) { return o.stealth_address == null_pkey; }
struct zz_is_out_burned_helper_visitor : boost::static_visitor<bool>
{
template<typename T>
bool operator()(const T& v) const { return is_out_burned(v); }
};
inline bool is_out_burned(const tx_out_v& v)
{
return boost::apply_visitor(zz_is_out_burned_helper_visitor(), v);
}
inline bool is_out_burned(const txout_target_v& v)
{
return boost::apply_visitor(zz_is_out_burned_helper_visitor(), v);
}
template<>
inline bool is_out_burned(const txout_target_v& v) { return boost::apply_visitor(zz_is_out_burned_helper_visitor(), v); }
template<>
inline bool is_out_burned(const tx_out_v& v) { return boost::apply_visitor(zz_is_out_burned_helper_visitor(), v); }
template<>
inline bool is_out_burned(const tx_out_bare& o) { return is_out_burned(o.target); }
template<class t_extra_container>
bool add_attachments_info_to_extra(t_extra_container& extra_container, const std::vector<attachment_v>& attachments)
{

View file

@ -714,6 +714,7 @@ void wallet2::process_new_transaction(const currency::transaction& tx, uint64_t
transfer_details_base& tdb = m_multisig_transfers[multisig_id];
tdb.m_ptx_wallet_info = pwallet_info;
tdb.m_internal_output_index = o;
tdb.m_amount = outs[i_in_outs].amount;
WLT_LOG_L0("Received multisig, multisig out id: " << multisig_id << ", amount: " << tdb.amount() << ", with tx: " << get_transaction_hash(tx));
}
}