aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-04-17 13:27:02 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-04-17 14:20:44 -0400
commitfad7c33342cb51b310a7dd372bfa675df8810367 (patch)
tree64bc06d2bdd76ca1dc13d9be5a28d6462e07e990 /src/wallet/wallet.cpp
parentfa46ac3127142358116c8473741708b3bb70ca15 (diff)
refactor: Add handleNotifications method to wallet
Further stylistic cleanups in touched files: * Sort the includes * Wrap long single-line constructors into multiple lines
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 98ba489729..4737e2f6f4 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -5,9 +5,8 @@
#include <wallet/wallet.h>
-#include <checkpoints.h>
#include <chain.h>
-#include <wallet/coincontrol.h>
+#include <checkpoints.h>
#include <consensus/consensus.h>
#include <consensus/validation.h>
#include <fs.h>
@@ -16,7 +15,6 @@
#include <key.h>
#include <key_io.h>
#include <keystore.h>
-#include <validation.h>
#include <net.h>
#include <policy/fees.h>
#include <policy/policy.h>
@@ -34,6 +32,8 @@
#include <util/moneystr.h>
#include <util/rbf.h>
#include <util/validation.h>
+#include <validation.h>
+#include <wallet/coincontrol.h>
#include <wallet/fees.h>
#include <algorithm>
@@ -4303,7 +4303,7 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
chain.loadWallet(interfaces::MakeWallet(walletInstance));
// Register with the validation interface. It's ok to do this after rescan since we're still holding locked_chain.
- walletInstance->m_chain_notifications_handler = chain.handleNotifications(*walletInstance);
+ walletInstance->handleNotifications();
walletInstance->SetBroadcastTransactions(gArgs.GetBoolArg("-walletbroadcast", DEFAULT_WALLETBROADCAST));
@@ -4316,6 +4316,11 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
return walletInstance;
}
+void CWallet::handleNotifications()
+{
+ m_chain_notifications_handler = m_chain->handleNotifications(*this);
+}
+
void CWallet::postInitProcess()
{
auto locked_chain = chain().lock();