From 031b060af030c218098ea59f3e520197ff7a913c Mon Sep 17 00:00:00 2001 From: Jaquee Date: Mon, 30 Jan 2017 11:57:58 +0100 Subject: [PATCH] wallet2::init() - disconnect before init if connected Makes it possible for GUI to reinit with new daemon without closing and reopening wallet. --- src/wallet/wallet2.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 9bdfc7b0..c52281a2 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -487,6 +487,8 @@ std::pair, password_container> wallet2::make_new(const //---------------------------------------------------------------------------------------------------- bool wallet2::init(std::string daemon_address, uint64_t upper_transaction_size_limit) { + if(m_http_client.is_connected()) + m_http_client.disconnect(); m_upper_transaction_size_limit = upper_transaction_size_limit; m_daemon_address = std::move(daemon_address); return m_http_client.set_server(get_daemon_address());