diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 21e49f5d..10bb0475 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -709,20 +709,21 @@ void wallet2::prepare_wti_decrypted_attachments(wallet_public::wallet_transfer_i } get_payment_id_from_tx(decrypted_att, wti.payment_id); + for (const auto& item : decrypted_att) + { + if (item.type() == typeid(currency::tx_service_attachment)) + { + wti.service_entries.push_back(boost::get(item)); + } + } + + if (wti.is_income) { account_public_address sender_address = AUTO_VAL_INIT(sender_address); wti.show_sender = handle_2_alternative_types_in_variant_container(decrypted_att, [&](const tx_payer& p) { sender_address = p.acc_addr; return false; /* <- continue? */ } ); if (wti.show_sender) wti.remote_addresses.push_back(currency::get_account_address_as_str(sender_address)); - - for (const auto& item : decrypted_att) - { - if (item.type() == typeid(currency::tx_service_attachment)) - { - wti.service_entries.push_back(boost::get(item)); - } - } } else { diff --git a/src/wallet/wallet_public_structs_defs.h b/src/wallet/wallet_public_structs_defs.h index d12d1367..960516db 100644 --- a/src/wallet/wallet_public_structs_defs.h +++ b/src/wallet/wallet_public_structs_defs.h @@ -342,6 +342,7 @@ namespace wallet_public */ bool update_provision_info; bool exclude_mining_txs; + bool exclude_unconfirmed; std::string order; // "FROM_BEGIN_TO_END" or "FROM_END_TO_BEGIN" BEGIN_KV_SERIALIZE_MAP() @@ -349,6 +350,7 @@ namespace wallet_public KV_SERIALIZE(count) KV_SERIALIZE(update_provision_info) KV_SERIALIZE(exclude_mining_txs) + KV_SERIALIZE(exclude_unconfirmed) KV_SERIALIZE(order) END_KV_SERIALIZE_MAP() }; diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index fdfb6f20..aca13701 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -249,7 +249,7 @@ namespace tools res.pi.curent_height = m_wallet.get_top_block_height(); } - if (req.offset == 0) + if (req.offset == 0 && !req.exclude_unconfirmed) m_wallet.get_unconfirmed_transfers(res.transfers, req.exclude_mining_txs); bool start_from_end = true;