use non-zero value instead of throwing in case of failed tx

This commit is contained in:
woodser
2021-01-12 13:11:11 -05:00
parent f0d5bd5e4b
commit c32f07ff05
+3 -2
View File
@@ -656,9 +656,10 @@ namespace monero {
// otherwise merge transfer fields
m_account_index = gen_utils::reconcile(m_account_index, other->m_account_index, "transfer m_account_index");
// TODO monero core: failed m_tx in pool (after testUpdateLockedDifferentAccounts()) causes non-originating saved wallets to return duplicate incoming transfers but one has amount of 0
// TODO monero core: failed tx in pool (after testUpdateLockedDifferentAccounts()) causes non-originating saved wallets to return duplicate incoming transfers but one has amount of 0
if (m_amount != boost::none && other->m_amount != boost::none && *m_amount != *other->m_amount && (*m_amount == 0 || *other->m_amount == 0)) {
throw std::runtime_error("failed tx in pool causes non-originating wallets to return duplicate incoming transfers but with one amount/m_num_suggested_confirmations of 0");
std::cout << "WARNING: failed tx in pool causes non-originating wallets to return duplicate incoming transfers but with one amount/m_num_suggested_confirmations of 0, using non-zero amount" << std::endl;
if (*m_amount == 0) m_amount = other->m_amount;
} else {
m_amount = gen_utils::reconcile(m_amount, other->m_amount, "transfer amount");
}