@@ -60,9 +60,9 @@ bool CWalletDB::EraseTx(uint256 hash)
60
60
61
61
bool CWalletDB::WriteKey (const CPubKey& vchPubKey, const CPrivKey& vchPrivKey, const CKeyMetadata& keyMeta)
62
62
{
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 )) {
65
64
return false ;
65
+ }
66
66
67
67
// hash pubkey/privkey to accelerate wallet load
68
68
std::vector<unsigned char > vchKey;
@@ -79,12 +79,13 @@ bool CWalletDB::WriteCryptedKey(const CPubKey& vchPubKey,
79
79
{
80
80
const bool fEraseUnencryptedKey = true ;
81
81
82
- if (!WriteIC (std::make_pair (std::string (" keymeta" ), vchPubKey),
83
- keyMeta))
82
+ if (!WriteIC (std::make_pair (std::string (" keymeta" ), vchPubKey), keyMeta)) {
84
83
return false ;
84
+ }
85
85
86
- if (!WriteIC (std::make_pair (std::string (" ckey" ), vchPubKey), vchCryptedSecret, false ))
86
+ if (!WriteIC (std::make_pair (std::string (" ckey" ), vchPubKey), vchCryptedSecret, false )) {
87
87
return false ;
88
+ }
88
89
if (fEraseUnencryptedKey )
89
90
{
90
91
EraseIC (std::make_pair (std::string (" key" ), vchPubKey));
@@ -106,15 +107,17 @@ bool CWalletDB::WriteCScript(const uint160& hash, const CScript& redeemScript)
106
107
107
108
bool CWalletDB::WriteWatchOnly (const CScript &dest, const CKeyMetadata& keyMeta)
108
109
{
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)) {
110
111
return false ;
112
+ }
111
113
return WriteIC (std::make_pair (std::string (" watchs" ), *(const CScriptBase*)(&dest)), ' 1' );
112
114
}
113
115
114
116
bool CWalletDB::EraseWatchOnly (const CScript &dest)
115
117
{
116
- if (!EraseIC (std::make_pair (std::string (" watchmeta" ), *(const CScriptBase*)(&dest))))
118
+ if (!EraseIC (std::make_pair (std::string (" watchmeta" ), *(const CScriptBase*)(&dest)))) {
117
119
return false ;
120
+ }
118
121
return EraseIC (std::make_pair (std::string (" watchs" ), *(const CScriptBase*)(&dest)));
119
122
}
120
123
0 commit comments