1
0
Fork 0
forked from lthn/blockchain

More options on wallet API

This commit is contained in:
cryptozoidberg 2021-07-21 00:25:12 +02:00
parent c0621eb2f2
commit 9936ef63cf
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC
3 changed files with 12 additions and 9 deletions

View file

@ -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<currency::tx_service_attachment>(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<tx_payer, tx_payer_old>(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<currency::tx_service_attachment>(item));
}
}
}
else
{

View file

@ -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()
};

View file

@ -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;