@@ -76,19 +76,18 @@ std::unique_ptr<PeerLogicValidation> peerLogic;
76
76
class DummyWalletInit : public WalletInitInterface {
77
77
public:
78
78
79
- std::string GetHelpString (bool showDebug) override {return std::string{};}
80
- bool ParameterInteraction () override {return true ;}
81
- void RegisterRPC (CRPCTable &) override {}
82
- bool Verify () override {return true ;}
83
- bool Open () override {LogPrintf (" No wallet support compiled in!\n " ); return true ;}
84
- void Start (CScheduler& scheduler) override {}
85
- void Flush () override {}
86
- void Stop () override {}
87
- void Close () override {}
79
+ std::string GetHelpString (bool showDebug) const override {return std::string{};}
80
+ bool ParameterInteraction () const override {return true ;}
81
+ void RegisterRPC (CRPCTable &) const override {}
82
+ bool Verify () const override {return true ;}
83
+ bool Open () const override {LogPrintf (" No wallet support compiled in!\n " ); return true ;}
84
+ void Start (CScheduler& scheduler) const override {}
85
+ void Flush () const override {}
86
+ void Stop () const override {}
87
+ void Close () const override {}
88
88
};
89
89
90
- static DummyWalletInit g_dummy_wallet_init;
91
- WalletInitInterface* const g_wallet_init_interface = &g_dummy_wallet_init;
90
+ const WalletInitInterface& g_wallet_init_interface = DummyWalletInit();
92
91
#endif
93
92
94
93
#if ENABLE_ZMQ
@@ -204,7 +203,7 @@ void Shutdown()
204
203
StopREST ();
205
204
StopRPC ();
206
205
StopHTTPServer ();
207
- g_wallet_init_interface-> Flush ();
206
+ g_wallet_init_interface. Flush ();
208
207
StopMapPort ();
209
208
210
209
// Because these depend on each-other, we make sure that neither can be
@@ -262,7 +261,7 @@ void Shutdown()
262
261
pcoinsdbview.reset ();
263
262
pblocktree.reset ();
264
263
}
265
- g_wallet_init_interface-> Stop ();
264
+ g_wallet_init_interface. Stop ();
266
265
267
266
#if ENABLE_ZMQ
268
267
if (pzmqNotificationInterface) {
@@ -282,7 +281,7 @@ void Shutdown()
282
281
UnregisterAllValidationInterfaces ();
283
282
GetMainSignals ().UnregisterBackgroundSignalScheduler ();
284
283
GetMainSignals ().UnregisterWithMempoolSignals (mempool);
285
- g_wallet_init_interface-> Close ();
284
+ g_wallet_init_interface. Close ();
286
285
globalVerifyHandle.reset ();
287
286
ECC_Stop ();
288
287
LogPrintf (" %s: done\n " , __func__);
@@ -425,7 +424,7 @@ std::string HelpMessage(HelpMessageMode mode)
425
424
strUsage += HelpMessageOpt (" -whitelist=<IP address or network>" , _ (" Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times." ) +
426
425
" " + _ (" Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway" ));
427
426
428
- strUsage += g_wallet_init_interface-> GetHelpString (showDebug);
427
+ strUsage += g_wallet_init_interface. GetHelpString (showDebug);
429
428
430
429
#if ENABLE_ZMQ
431
430
strUsage += HelpMessageGroup (_ (" ZeroMQ notification options:" ));
@@ -1098,7 +1097,7 @@ bool AppInitParameterInteraction()
1098
1097
return InitError (strprintf (" acceptnonstdtxn is not currently supported for %s chain" , chainparams.NetworkIDString ()));
1099
1098
nBytesPerSigOp = gArgs .GetArg (" -bytespersigop" , nBytesPerSigOp);
1100
1099
1101
- if (!g_wallet_init_interface-> ParameterInteraction ()) return false ;
1100
+ if (!g_wallet_init_interface. ParameterInteraction ()) return false ;
1102
1101
1103
1102
fIsBareMultisigStd = gArgs .GetBoolArg (" -permitbaremultisig" , DEFAULT_PERMIT_BAREMULTISIG);
1104
1103
fAcceptDatacarrier = gArgs .GetBoolArg (" -datacarrier" , DEFAULT_ACCEPT_DATACARRIER);
@@ -1264,7 +1263,7 @@ bool AppInitMain()
1264
1263
* available in the GUI RPC console even if external calls are disabled.
1265
1264
*/
1266
1265
RegisterAllCoreRPCCommands (tableRPC);
1267
- g_wallet_init_interface-> RegisterRPC (tableRPC);
1266
+ g_wallet_init_interface. RegisterRPC (tableRPC);
1268
1267
1269
1268
/* Start the RPC server already. It will be started in "warmup" mode
1270
1269
* and not really process calls already (but it will signify connections
@@ -1281,7 +1280,7 @@ bool AppInitMain()
1281
1280
int64_t nStart;
1282
1281
1283
1282
// ********************************************************* Step 5: verify wallet database integrity
1284
- if (!g_wallet_init_interface-> Verify ()) return false ;
1283
+ if (!g_wallet_init_interface. Verify ()) return false ;
1285
1284
1286
1285
// ********************************************************* Step 6: network initialization
1287
1286
// Note that we absolutely cannot open any actual connections
@@ -1600,7 +1599,7 @@ bool AppInitMain()
1600
1599
fFeeEstimatesInitialized = true ;
1601
1600
1602
1601
// ********************************************************* Step 8: load wallet
1603
- if (!g_wallet_init_interface-> Open ()) return false ;
1602
+ if (!g_wallet_init_interface. Open ()) return false ;
1604
1603
1605
1604
// ********************************************************* Step 9: data directory maintenance
1606
1605
@@ -1746,7 +1745,7 @@ bool AppInitMain()
1746
1745
SetRPCWarmupFinished ();
1747
1746
uiInterface.InitMessage (_ (" Done loading" ));
1748
1747
1749
- g_wallet_init_interface-> Start (scheduler);
1748
+ g_wallet_init_interface. Start (scheduler);
1750
1749
1751
1750
return true ;
1752
1751
}
0 commit comments