From af8ef3399add3f3380180d6fb512c403e06268dc Mon Sep 17 00:00:00 2001 From: sowle Date: Tue, 7 Apr 2020 16:29:03 +0300 Subject: [PATCH] simplewallet in RPC mode now scans tx pool even if PoS-mining not activated (fixes unconfirmed txs for RPC API) closes #165 --- src/wallet/wallet_rpc_server.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index e8fbb098..31a1ef7b 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -74,11 +74,12 @@ namespace tools return true; } + bool has_related_alias_in_unconfirmed = false; + LOG_PRINT_L2("wallet RPC idle: scanning tx pool..."); + m_wallet.scan_tx_pool(has_related_alias_in_unconfirmed); + if (m_do_mint) { - bool has_related_alias_in_unconfirmed = false; - LOG_PRINT_L2("wallet RPC idle: scanning tx pool..."); - m_wallet.scan_tx_pool(has_related_alias_in_unconfirmed); LOG_PRINT_L2("wallet RPC idle: trying to do PoS iteration..."); m_wallet.try_mint_pos(miner_address); } @@ -582,7 +583,7 @@ namespace tools { bool tx_id_specified = req.tx_id != currency::null_hash; - // + // process confirmed txs m_wallet.enumerate_transfers_history([&](const wallet_public::wallet_transfer_info& wti) -> bool { if (tx_id_specified) @@ -616,7 +617,7 @@ namespace tools return true; // continue }, false /* enumerate_forward */); - + // process unconfirmed txs if (req.pool) { m_wallet.enumerate_unconfirmed_transfers([&](const wallet_public::wallet_transfer_info& wti) -> bool {