@@ -87,8 +87,7 @@ class DummyWalletInit : public WalletInitInterface {
87
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:" ));
@@ -1093,7 +1092,7 @@ bool AppInitParameterInteraction()
1093
1092
return InitError (strprintf (" acceptnonstdtxn is not currently supported for %s chain" , chainparams.NetworkIDString ()));
1094
1093
nBytesPerSigOp = gArgs .GetArg (" -bytespersigop" , nBytesPerSigOp);
1095
1094
1096
- if (!g_wallet_init_interface-> ParameterInteraction ()) return false ;
1095
+ if (!g_wallet_init_interface. ParameterInteraction ()) return false ;
1097
1096
1098
1097
fIsBareMultisigStd = gArgs .GetBoolArg (" -permitbaremultisig" , DEFAULT_PERMIT_BAREMULTISIG);
1099
1098
fAcceptDatacarrier = gArgs .GetBoolArg (" -datacarrier" , DEFAULT_ACCEPT_DATACARRIER);
@@ -1259,7 +1258,7 @@ bool AppInitMain()
1259
1258
* available in the GUI RPC console even if external calls are disabled.
1260
1259
*/
1261
1260
RegisterAllCoreRPCCommands (tableRPC);
1262
- g_wallet_init_interface-> RegisterRPC (tableRPC);
1261
+ g_wallet_init_interface. RegisterRPC (tableRPC);
1263
1262
1264
1263
/* Start the RPC server already. It will be started in "warmup" mode
1265
1264
* and not really process calls already (but it will signify connections
@@ -1276,7 +1275,7 @@ bool AppInitMain()
1276
1275
int64_t nStart;
1277
1276
1278
1277
// ********************************************************* Step 5: verify wallet database integrity
1279
- if (!g_wallet_init_interface-> Verify ()) return false ;
1278
+ if (!g_wallet_init_interface. Verify ()) return false ;
1280
1279
1281
1280
// ********************************************************* Step 6: network initialization
1282
1281
// Note that we absolutely cannot open any actual connections
@@ -1595,7 +1594,7 @@ bool AppInitMain()
1595
1594
fFeeEstimatesInitialized = true ;
1596
1595
1597
1596
// ********************************************************* Step 8: load wallet
1598
- if (!g_wallet_init_interface-> Open ()) return false ;
1597
+ if (!g_wallet_init_interface. Open ()) return false ;
1599
1598
1600
1599
// ********************************************************* Step 9: data directory maintenance
1601
1600
@@ -1741,7 +1740,7 @@ bool AppInitMain()
1741
1740
SetRPCWarmupFinished ();
1742
1741
uiInterface.InitMessage (_ (" Done loading" ));
1743
1742
1744
- g_wallet_init_interface-> Start (scheduler);
1743
+ g_wallet_init_interface. Start (scheduler);
1745
1744
1746
1745
return true ;
1747
1746
}
0 commit comments