@@ -344,7 +344,7 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
344
344
FILE *file = fopen (path.string ().c_str (), " rb" );
345
345
if (file) {
346
346
CImportingNow imp;
347
- LogPrintf (" Importing %s...\n " , path.string (). c_str () );
347
+ LogPrintf (" Importing %s...\n " , path.string ());
348
348
LoadExternalBlockFile (file);
349
349
}
350
350
}
@@ -512,22 +512,22 @@ bool AppInit2(boost::thread_group& threadGroup)
512
512
if (ParseMoney (mapArgs[" -mintxfee" ], n) && n > 0 )
513
513
CTransaction::nMinTxFee = n;
514
514
else
515
- return InitError (strprintf (_ (" Invalid amount for -mintxfee=<amount>: '%s'" ), mapArgs[" -mintxfee" ]. c_str () ));
515
+ return InitError (strprintf (_ (" Invalid amount for -mintxfee=<amount>: '%s'" ), mapArgs[" -mintxfee" ]));
516
516
}
517
517
if (mapArgs.count (" -minrelaytxfee" ))
518
518
{
519
519
int64_t n = 0 ;
520
520
if (ParseMoney (mapArgs[" -minrelaytxfee" ], n) && n > 0 )
521
521
CTransaction::nMinRelayTxFee = n;
522
522
else
523
- return InitError (strprintf (_ (" Invalid amount for -minrelaytxfee=<amount>: '%s'" ), mapArgs[" -minrelaytxfee" ]. c_str () ));
523
+ return InitError (strprintf (_ (" Invalid amount for -minrelaytxfee=<amount>: '%s'" ), mapArgs[" -minrelaytxfee" ]));
524
524
}
525
525
526
526
#ifdef ENABLE_WALLET
527
527
if (mapArgs.count (" -paytxfee" ))
528
528
{
529
529
if (!ParseMoney (mapArgs[" -paytxfee" ], nTransactionFee))
530
- return InitError (strprintf (_ (" Invalid amount for -paytxfee=<amount>: '%s'" ), mapArgs[" -paytxfee" ]. c_str () ));
530
+ return InitError (strprintf (_ (" Invalid amount for -paytxfee=<amount>: '%s'" ), mapArgs[" -paytxfee" ]));
531
531
if (nTransactionFee > 0.25 * COIN)
532
532
InitWarning (_ (" Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction." ));
533
533
}
@@ -540,25 +540,25 @@ bool AppInit2(boost::thread_group& threadGroup)
540
540
#ifdef ENABLE_WALLET
541
541
// Wallet file must be a plain filename without a directory
542
542
if (strWalletFile != boost::filesystem::basename (strWalletFile) + boost::filesystem::extension (strWalletFile))
543
- return InitError (strprintf (_ (" Wallet %s resides outside data directory %s" ), strWalletFile. c_str () , strDataDir. c_str () ));
543
+ return InitError (strprintf (_ (" Wallet %s resides outside data directory %s" ), strWalletFile, strDataDir));
544
544
#endif
545
545
// Make sure only a single Bitcoin process is using the data directory.
546
546
boost::filesystem::path pathLockFile = GetDataDir () / " .lock" ;
547
547
FILE* file = fopen (pathLockFile.string ().c_str (), " a" ); // empty lock file; created if it doesn't exist.
548
548
if (file) fclose (file);
549
549
static boost::interprocess::file_lock lock (pathLockFile.string ().c_str ());
550
550
if (!lock.try_lock ())
551
- return InitError (strprintf (_ (" Cannot obtain a lock on data directory %s. Bitcoin is probably already running." ), strDataDir. c_str () ));
551
+ return InitError (strprintf (_ (" Cannot obtain a lock on data directory %s. Bitcoin is probably already running." ), strDataDir));
552
552
553
553
if (GetBoolArg (" -shrinkdebugfile" , !fDebug ))
554
554
ShrinkDebugFile ();
555
555
LogPrintf (" \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n " );
556
- LogPrintf (" Bitcoin version %s (%s)\n " , FormatFullVersion (). c_str () , CLIENT_DATE. c_str () );
556
+ LogPrintf (" Bitcoin version %s (%s)\n " , FormatFullVersion (), CLIENT_DATE);
557
557
LogPrintf (" Using OpenSSL version %s\n " , SSLeay_version (SSLEAY_VERSION));
558
558
if (!fLogTimestamps )
559
- LogPrintf (" Startup time: %s\n " , DateTimeStrFormat (" %Y-%m-%d %H:%M:%S" , GetTime ()). c_str () );
560
- LogPrintf (" Default data directory %s\n " , GetDefaultDataDir ().string (). c_str () );
561
- LogPrintf (" Using data directory %s\n " , strDataDir. c_str () );
559
+ LogPrintf (" Startup time: %s\n " , DateTimeStrFormat (" %Y-%m-%d %H:%M:%S" , GetTime ()));
560
+ LogPrintf (" Default data directory %s\n " , GetDefaultDataDir ().string ());
561
+ LogPrintf (" Using data directory %s\n " , strDataDir);
562
562
LogPrintf (" Using at most %i connections (%i file descriptors available)\n " , nMaxConnections, nFD);
563
563
std::ostringstream strErrors;
564
564
@@ -582,15 +582,15 @@ bool AppInit2(boost::thread_group& threadGroup)
582
582
boost::filesystem::path pathDatabaseBak = GetDataDir () / strprintf (" database.%" PRId64" .bak" , GetTime ());
583
583
try {
584
584
boost::filesystem::rename (pathDatabase, pathDatabaseBak);
585
- LogPrintf (" Moved old %s to %s. Retrying.\n " , pathDatabase.string (). c_str () , pathDatabaseBak.string (). c_str ());
585
+ LogPrintf (" Moved old %s to %s. Retrying.\n " , pathDatabase.string (), pathDatabaseBak.string ());
586
586
} catch (boost::filesystem::filesystem_error &error) {
587
587
// failure is ok (well, not really, but it's not worse than what we started with)
588
588
}
589
589
590
590
// try again
591
591
if (!bitdb.Open (GetDataDir ())) {
592
592
// if it still fails, it probably means we can't even create the database env
593
- string msg = strprintf (_ (" Error initializing wallet database environment %s!" ), strDataDir. c_str () );
593
+ string msg = strprintf (_ (" Error initializing wallet database environment %s!" ), strDataDir);
594
594
return InitError (msg);
595
595
}
596
596
}
@@ -610,7 +610,7 @@ bool AppInit2(boost::thread_group& threadGroup)
610
610
string msg = strprintf (_ (" Warning: wallet.dat corrupt, data salvaged!"
611
611
" Original wallet.dat saved as wallet.{timestamp}.bak in %s; if"
612
612
" your balance or transactions are incorrect you should"
613
- " restore from a backup." ), strDataDir. c_str () );
613
+ " restore from a backup." ), strDataDir);
614
614
InitWarning (msg);
615
615
}
616
616
if (r == CDBEnv::RECOVER_FAIL)
@@ -631,7 +631,7 @@ bool AppInit2(boost::thread_group& threadGroup)
631
631
BOOST_FOREACH (std::string snet, mapMultiArgs[" -onlynet" ]) {
632
632
enum Network net = ParseNetwork (snet);
633
633
if (net == NET_UNROUTABLE)
634
- return InitError (strprintf (_ (" Unknown network specified in -onlynet: '%s'" ), snet. c_str () ));
634
+ return InitError (strprintf (_ (" Unknown network specified in -onlynet: '%s'" ), snet));
635
635
nets.insert (net);
636
636
}
637
637
for (int n = 0 ; n < NET_MAX; n++) {
@@ -652,7 +652,7 @@ bool AppInit2(boost::thread_group& threadGroup)
652
652
if (mapArgs.count (" -proxy" )) {
653
653
addrProxy = CService (mapArgs[" -proxy" ], 9050 );
654
654
if (!addrProxy.IsValid ())
655
- return InitError (strprintf (_ (" Invalid -proxy address: '%s'" ), mapArgs[" -proxy" ]. c_str () ));
655
+ return InitError (strprintf (_ (" Invalid -proxy address: '%s'" ), mapArgs[" -proxy" ]));
656
656
657
657
if (!IsLimited (NET_IPV4))
658
658
SetProxy (NET_IPV4, addrProxy, nSocksVersion);
@@ -679,7 +679,7 @@ bool AppInit2(boost::thread_group& threadGroup)
679
679
else
680
680
addrOnion = mapArgs.count (" -onion" )?CService (mapArgs[" -onion" ], 9050 ):CService (mapArgs[" -tor" ], 9050 );
681
681
if (!addrOnion.IsValid ())
682
- return InitError (strprintf (_ (" Invalid -onion address: '%s'" ), mapArgs.count (" -onion" )?mapArgs[" -onion" ]. c_str () :mapArgs[" -tor" ]. c_str () ));
682
+ return InitError (strprintf (_ (" Invalid -onion address: '%s'" ), mapArgs.count (" -onion" )?mapArgs[" -onion" ]:mapArgs[" -tor" ]));
683
683
SetProxy (NET_TOR, addrOnion, 5 );
684
684
SetReachable (NET_TOR);
685
685
}
@@ -695,7 +695,7 @@ bool AppInit2(boost::thread_group& threadGroup)
695
695
BOOST_FOREACH (std::string strBind, mapMultiArgs[" -bind" ]) {
696
696
CService addrBind;
697
697
if (!Lookup (strBind.c_str (), addrBind, GetListenPort (), false ))
698
- return InitError (strprintf (_ (" Cannot resolve -bind address: '%s'" ), strBind. c_str () ));
698
+ return InitError (strprintf (_ (" Cannot resolve -bind address: '%s'" ), strBind));
699
699
fBound |= Bind (addrBind, (BF_EXPLICIT | BF_REPORT_ERROR));
700
700
}
701
701
}
@@ -715,7 +715,7 @@ bool AppInit2(boost::thread_group& threadGroup)
715
715
BOOST_FOREACH (string strAddr, mapMultiArgs[" -externalip" ]) {
716
716
CService addrLocal (strAddr, GetListenPort (), fNameLookup );
717
717
if (!addrLocal.IsValid ())
718
- return InitError (strprintf (_ (" Cannot resolve -externalip address: '%s'" ), strAddr. c_str () ));
718
+ return InitError (strprintf (_ (" Cannot resolve -externalip address: '%s'" ), strAddr));
719
719
AddLocal (CService (strAddr, GetListenPort (), fNameLookup ), LOCAL_MANUAL);
720
720
}
721
721
}
@@ -739,7 +739,7 @@ bool AppInit2(boost::thread_group& threadGroup)
739
739
filesystem::path dest = blocksDir / strprintf (" blk%05u.dat" , i-1 );
740
740
try {
741
741
filesystem::create_hard_link (source, dest);
742
- LogPrintf (" Hardlinked %s -> %s\n " , source.string (). c_str () , dest.string (). c_str ());
742
+ LogPrintf (" Hardlinked %s -> %s\n " , source.string (), dest.string ());
743
743
linked = true ;
744
744
} catch (filesystem::filesystem_error & e) {
745
745
// Note: hardlink creation failing is not a disaster, it just means
@@ -879,7 +879,7 @@ bool AppInit2(boost::thread_group& threadGroup)
879
879
}
880
880
}
881
881
if (nFound == 0 )
882
- LogPrintf (" No blocks matching %s were found\n " , strMatch. c_str () );
882
+ LogPrintf (" No blocks matching %s were found\n " , strMatch);
883
883
return false ;
884
884
}
885
885
@@ -910,7 +910,7 @@ bool AppInit2(boost::thread_group& threadGroup)
910
910
else if (nLoadWalletRet == DB_NEED_REWRITE)
911
911
{
912
912
strErrors << _ (" Wallet needed to be rewritten: restart Bitcoin to complete" ) << " \n " ;
913
- LogPrintf (" %s" , strErrors.str (). c_str () );
913
+ LogPrintf (" %s" , strErrors.str ());
914
914
return InitError (strErrors.str ());
915
915
}
916
916
else
@@ -948,7 +948,7 @@ bool AppInit2(boost::thread_group& threadGroup)
948
948
pwalletMain->SetBestChain (chainActive.GetLocator ());
949
949
}
950
950
951
- LogPrintf (" %s" , strErrors.str (). c_str () );
951
+ LogPrintf (" %s" , strErrors.str ());
952
952
LogPrintf (" wallet %15" PRId64" ms\n " , GetTimeMillis () - nStart);
953
953
954
954
RegisterWallet (pwalletMain);
0 commit comments