@@ -80,11 +80,9 @@ bool CWalletDB::EraseTx(uint256 hash)
80
80
81
81
bool CWalletDB::WriteKey (const CPubKey& vchPubKey, const CPrivKey& vchPrivKey, const CKeyMetadata& keyMeta)
82
82
{
83
- nWalletDBUpdateCounter++;
84
-
85
- if (!Write (std::make_pair (std::string (" keymeta" ), vchPubKey),
86
- keyMeta, false ))
83
+ if (!WriteIC (std::make_pair (std::string (" keymeta" ), vchPubKey), keyMeta, false )) {
87
84
return false ;
85
+ }
88
86
89
87
// hash pubkey/privkey to accelerate wallet load
90
88
std::vector<unsigned char > vchKey;
@@ -102,12 +100,13 @@ bool CWalletDB::WriteCryptedKey(const CPubKey& vchPubKey,
102
100
const bool fEraseUnencryptedKey = true ;
103
101
nWalletDBUpdateCounter++;
104
102
105
- if (!Write (std::make_pair (std::string (" keymeta" ), vchPubKey),
106
- keyMeta))
103
+ if (!WriteIC (std::make_pair (std::string (" keymeta" ), vchPubKey), keyMeta)) {
107
104
return false ;
105
+ }
108
106
109
- if (!Write (std::make_pair (std::string (" ckey" ), vchPubKey), vchCryptedSecret, false ))
107
+ if (!WriteIC (std::make_pair (std::string (" ckey" ), vchPubKey), vchCryptedSecret, false )) {
110
108
return false ;
109
+ }
111
110
if (fEraseUnencryptedKey )
112
111
{
113
112
Erase (std::make_pair (std::string (" key" ), vchPubKey));
@@ -130,29 +129,22 @@ bool CWalletDB::WriteCScript(const uint160& hash, const CScript& redeemScript)
130
129
131
130
bool CWalletDB::WriteWatchOnly (const CScript &dest, const CKeyMetadata& keyMeta)
132
131
{
132
+ <<<<<<< HEAD
133
133
nWalletDBUpdateCounter++;
134
134
if (!Write (std::make_pair (std::string (" watchmeta" ), *(const CScriptBase*)(&dest)), keyMeta))
135
135
return false ;
136
- return Write ( std::make_pair ( std::string ( " watchs " ), *( const CScriptBase*)(&dest)), ' 1 ' );
136
+ >>>>>>> c237bd750e... wallet: Update formatting
137
137
}
138
138
139
139
bool CWalletDB::EraseWatchOnly (const CScript &dest)
140
- {
141
- nWalletDBUpdateCounter++;
142
- if (!Erase (std::make_pair (std::string (" watchmeta" ), *(const CScriptBase*)(&dest))))
140
+ if (!EraseIC(std::make_pair(std::string(" watchmeta" ), *(const CScriptBase*)(&dest)))) {
143
141
return false ;
144
- return Erase (std::make_pair (std::string (" watchs" ), *(const CScriptBase*)(&dest)));
145
- }
146
-
147
- bool CWalletDB::WriteBestBlock (const CBlockLocator& locator)
148
- {
149
- nWalletDBUpdateCounter++;
150
- Write (std::string (" bestblock" ), CBlockLocator ()); // Write empty block locator so versions that require a merkle branch automatically rescan
142
+ }
143
+ return EraseIC(std::make_pair(std::string(" watchs" ), *(const CScriptBase*)(&dest)));
151
144
return Write(std::string(" bestblock_nomerkle" ), locator);
152
145
}
153
146
154
147
bool CWalletDB::ReadBestBlock (CBlockLocator& locator)
155
- {
156
148
if (Read(std::string(" bestblock" ), locator) && !locator.vHave.empty()) return true;
157
149
return Read(std::string(" bestblock_nomerkle" ), locator);
158
150
}
0 commit comments