1
0
Fork 0
forked from lthn/blockchain

wallet2: sending to auditable addresses allowed before HF2 as well

This commit is contained in:
sowle 2020-05-19 20:19:54 +03:00
parent df8c4b6594
commit 586561411d
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
2 changed files with 0 additions and 17 deletions

View file

@ -4478,28 +4478,12 @@ void wallet2::check_and_throw_if_self_directed_tx_with_payment_id_requested(cons
WLT_THROW_IF_FALSE_WALLET_CMN_ERR_EX(!has_payment_id, "sending funds to yourself with payment id is not allowed");
}
//----------------------------------------------------------------------------------------------------
void wallet2::check_and_throw_if_auditable_address_is_targeted_before_hf2(const construct_tx_param& ctp)
{
if (get_top_block_height() <= m_core_runtime_config.hard_fork_02_starts_after_height)
{
// before HF2
for (auto& d : ctp.dsts)
{
for (auto& addr : d.addr)
{
WLT_THROW_IF_FALSE_WALLET_CMN_ERR_EX(!addr.is_auditable(), "sending fund to an auditable address is not supported until HF2, address = " << get_account_address_as_str(addr));
}
}
}
}
//----------------------------------------------------------------------------------------------------
void wallet2::transfer(const construct_tx_param& ctp,
currency::transaction &tx,
bool send_to_network,
std::string* p_signed_tx_blob_str)
{
check_and_throw_if_self_directed_tx_with_payment_id_requested(ctp);
check_and_throw_if_auditable_address_is_targeted_before_hf2(ctp);
TIME_MEASURE_START(prepare_transaction_time);
finalize_tx_param ftp = AUTO_VAL_INIT(ftp);

View file

@ -927,7 +927,6 @@ private:
bool generate_packing_transaction_if_needed(currency::transaction& tx, uint64_t fake_outputs_number);
bool store_unsigned_tx_to_file_and_reserve_transfers(const finalize_tx_param& ftp, const std::string& filename, std::string* p_unsigned_tx_blob_str = nullptr);
void check_and_throw_if_self_directed_tx_with_payment_id_requested(const construct_tx_param& ctp);
void check_and_throw_if_auditable_address_is_targeted_before_hf2(const construct_tx_param& ctp);
void push_new_block_id(const crypto::hash& id, uint64_t height);
bool lookup_item_around(uint64_t i, std::pair<uint64_t, crypto::hash>& result);
//void get_short_chain_history(std::list<crypto::hash>& ids);