mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-27 05:13:25 +01:00
Merge pull request #574
61ce8d6
wallet_rpc_server: exit async, so we reply to stop_wallet RPC (moneromooo-monero)9847db6
wallet: do not return error if incoming_transfers finds none (moneromooo-monero)
This commit is contained in:
commit
b6d41cdac1
@ -57,6 +57,7 @@ namespace tools
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
bool wallet_rpc_server::run()
|
||||
{
|
||||
m_stop = false;
|
||||
m_net_server.add_idle_handler([this](){
|
||||
try {
|
||||
m_wallet.refresh();
|
||||
@ -65,6 +66,14 @@ namespace tools
|
||||
}
|
||||
return true;
|
||||
}, 20000);
|
||||
m_net_server.add_idle_handler([this](){
|
||||
if (m_stop.load(std::memory_order_relaxed))
|
||||
{
|
||||
send_stop_signal();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}, 500);
|
||||
|
||||
//DO NOT START THIS SERVER IN MORE THEN 1 THREADS WITHOUT REFACTORING
|
||||
return epee::http_server_impl_base<wallet_rpc_server, connection_context>::run(1, true);
|
||||
@ -605,11 +614,6 @@ namespace tools
|
||||
}
|
||||
}
|
||||
|
||||
if (!transfers_found)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
@ -653,8 +657,8 @@ namespace tools
|
||||
|
||||
try
|
||||
{
|
||||
send_stop_signal();
|
||||
m_wallet.store();
|
||||
m_stop.store(true, std::memory_order_relaxed);
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
|
@ -102,5 +102,6 @@ namespace tools
|
||||
wallet2& m_wallet;
|
||||
std::string m_port;
|
||||
std::string m_bind_ip;
|
||||
std::atomic<bool> m_stop;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user