1
0
Fork 0
forked from lthn/blockchain

wallet: minor htlc error-handling improvement

This commit is contained in:
sowle 2022-05-01 21:07:17 +02:00
parent 2b1d890b74
commit bbdd6595bf
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -404,8 +404,9 @@ void wallet2::process_new_transaction(const currency::transaction& tx, uint64_t
if (it != m_active_htlcs.end())
{
transfer_details& td = m_transfers[it->second];
WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(td.m_ptx_wallet_info->m_tx.vout.size() > td.m_internal_output_index, "Internal error: wrong index in m_transfers");
WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(td.m_ptx_wallet_info->m_tx.vout[td.m_internal_output_index].target.type() == typeid(txout_htlc), "Internal error: wrong index in m_transfers");
WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(td.m_ptx_wallet_info->m_tx.vout.size() > td.m_internal_output_index, "Internal error: wrong td.m_internal_output_index: " << td.m_internal_output_index);
const boost::typeindex::type_info& ti = td.m_ptx_wallet_info->m_tx.vout[td.m_internal_output_index].target.type();
WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(ti == typeid(txout_htlc), "Internal error: wrong type of output's target: " << ti.name());
//input spend active htlc
m_transfers[it->second].m_spent_height = height;
transfer_details_extra_option_htlc_info& tdeohi = get_or_add_field_to_variant_vector<transfer_details_extra_option_htlc_info>(td.varian_options);