forked from lthn/blockchain
wallet2: disallow auditable addresses as destinations until HF2 in transfer()
This commit is contained in:
parent
af3dbaa2e7
commit
3c30c655ff
2 changed files with 17 additions and 0 deletions
|
|
@ -4472,12 +4472,28 @@ 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");
|
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,
|
void wallet2::transfer(const construct_tx_param& ctp,
|
||||||
currency::transaction &tx,
|
currency::transaction &tx,
|
||||||
bool send_to_network,
|
bool send_to_network,
|
||||||
std::string* p_signed_tx_blob_str)
|
std::string* p_signed_tx_blob_str)
|
||||||
{
|
{
|
||||||
check_and_throw_if_self_directed_tx_with_payment_id_requested(ctp);
|
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);
|
TIME_MEASURE_START(prepare_transaction_time);
|
||||||
finalize_tx_param ftp = AUTO_VAL_INIT(ftp);
|
finalize_tx_param ftp = AUTO_VAL_INIT(ftp);
|
||||||
|
|
|
||||||
|
|
@ -904,6 +904,7 @@ private:
|
||||||
bool generate_packing_transaction_if_needed(currency::transaction& tx, uint64_t fake_outputs_number);
|
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);
|
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_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);
|
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);
|
bool lookup_item_around(uint64_t i, std::pair<uint64_t, crypto::hash>& result);
|
||||||
//void get_short_chain_history(std::list<crypto::hash>& ids);
|
//void get_short_chain_history(std::list<crypto::hash>& ids);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue