Skip to content

Commit c237bd7

Browse files
committed
wallet: Update formatting
1 parent 9cbe8c8 commit c237bd7

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

src/wallet/wallet.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -450,24 +450,25 @@ bool CWallet::Verify()
450450
}
451451

452452
std::string strError;
453-
if (!CWalletDB::VerifyEnvironment(walletFile, GetDataDir().string(), strError))
453+
if (!CWalletDB::VerifyEnvironment(walletFile, GetDataDir().string(), strError)) {
454454
return InitError(strError);
455+
}
455456

456-
if (GetBoolArg("-salvagewallet", false))
457-
{
457+
if (GetBoolArg("-salvagewallet", false)) {
458458
// Recover readable keypairs:
459459
CWallet dummyWallet;
460460
std::string backup_filename;
461-
if (!CWalletDB::Recover(walletFile, (void *)&dummyWallet, CWalletDB::RecoverKeysOnlyFilter, backup_filename))
461+
if (!CWalletDB::Recover(walletFile, (void *)&dummyWallet, CWalletDB::RecoverKeysOnlyFilter, backup_filename)) {
462462
return false;
463+
}
463464
}
464465

465466
std::string strWarning;
466467
bool dbV = CWalletDB::VerifyDatabaseFile(walletFile, GetDataDir().string(), strWarning, strError);
467-
if (!strWarning.empty())
468+
if (!strWarning.empty()) {
468469
InitWarning(strWarning);
469-
if (!dbV)
470-
{
470+
}
471+
if (!dbV) {
471472
InitError(strError);
472473
return false;
473474
}
@@ -2880,8 +2881,9 @@ bool CWallet::AddAccountingEntry(const CAccountingEntry& acentry)
28802881

28812882
bool CWallet::AddAccountingEntry(const CAccountingEntry& acentry, CWalletDB *pwalletdb)
28822883
{
2883-
if (!pwalletdb->WriteAccountingEntry(++nAccountingEntryNumber, acentry))
2884+
if (!pwalletdb->WriteAccountingEntry(++nAccountingEntryNumber, acentry)) {
28842885
return false;
2886+
}
28852887

28862888
laccentries.push_back(acentry);
28872889
CAccountingEntry & entry = laccentries.back();

src/wallet/walletdb.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ bool CWalletDB::EraseTx(uint256 hash)
6060

6161
bool CWalletDB::WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey, const CKeyMetadata& keyMeta)
6262
{
63-
if (!WriteIC(std::make_pair(std::string("keymeta"), vchPubKey),
64-
keyMeta, false))
63+
if (!WriteIC(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta, false)) {
6564
return false;
65+
}
6666

6767
// hash pubkey/privkey to accelerate wallet load
6868
std::vector<unsigned char> vchKey;
@@ -79,12 +79,13 @@ bool CWalletDB::WriteCryptedKey(const CPubKey& vchPubKey,
7979
{
8080
const bool fEraseUnencryptedKey = true;
8181

82-
if (!WriteIC(std::make_pair(std::string("keymeta"), vchPubKey),
83-
keyMeta))
82+
if (!WriteIC(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta)) {
8483
return false;
84+
}
8585

86-
if (!WriteIC(std::make_pair(std::string("ckey"), vchPubKey), vchCryptedSecret, false))
86+
if (!WriteIC(std::make_pair(std::string("ckey"), vchPubKey), vchCryptedSecret, false)) {
8787
return false;
88+
}
8889
if (fEraseUnencryptedKey)
8990
{
9091
EraseIC(std::make_pair(std::string("key"), vchPubKey));
@@ -106,15 +107,17 @@ bool CWalletDB::WriteCScript(const uint160& hash, const CScript& redeemScript)
106107

107108
bool CWalletDB::WriteWatchOnly(const CScript &dest, const CKeyMetadata& keyMeta)
108109
{
109-
if (!WriteIC(std::make_pair(std::string("watchmeta"), *(const CScriptBase*)(&dest)), keyMeta))
110+
if (!WriteIC(std::make_pair(std::string("watchmeta"), *(const CScriptBase*)(&dest)), keyMeta)) {
110111
return false;
112+
}
111113
return WriteIC(std::make_pair(std::string("watchs"), *(const CScriptBase*)(&dest)), '1');
112114
}
113115

114116
bool CWalletDB::EraseWatchOnly(const CScript &dest)
115117
{
116-
if (!EraseIC(std::make_pair(std::string("watchmeta"), *(const CScriptBase*)(&dest))))
118+
if (!EraseIC(std::make_pair(std::string("watchmeta"), *(const CScriptBase*)(&dest)))) {
117119
return false;
120+
}
118121
return EraseIC(std::make_pair(std::string("watchs"), *(const CScriptBase*)(&dest)));
119122
}
120123

0 commit comments

Comments
 (0)