@@ -108,7 +108,7 @@ CPubKey CWallet::GenerateNewKey()
108
108
109
109
// try to get the master key
110
110
if (!GetKey (hdChain.masterKeyID , key))
111
- throw std::runtime_error (" CWallet::GenerateNewKey() : Master key not found" );
111
+ throw std::runtime_error (std::string (__func__) + " : Master key not found" );
112
112
113
113
masterKey.SetMaster (key.begin (), key.size ());
114
114
@@ -135,7 +135,7 @@ CPubKey CWallet::GenerateNewKey()
135
135
136
136
// update the chain model in the database
137
137
if (!CWalletDB (strWalletFile).WriteHDChain (hdChain))
138
- throw std::runtime_error (" CWallet::GenerateNewKey() : Writing HD chain model failed" );
138
+ throw std::runtime_error (std::string (__func__) + " : Writing HD chain model failed" );
139
139
} else {
140
140
secret.MakeNewKey (fCompressed );
141
141
}
@@ -152,7 +152,7 @@ CPubKey CWallet::GenerateNewKey()
152
152
nTimeFirstKey = nCreationTime;
153
153
154
154
if (!AddKeyPubKey (secret, pubkey))
155
- throw std::runtime_error (" CWallet::GenerateNewKey() : AddKey failed" );
155
+ throw std::runtime_error (std::string (__func__) + " : AddKey failed" );
156
156
return pubkey;
157
157
}
158
158
@@ -1094,7 +1094,7 @@ isminetype CWallet::IsMine(const CTxOut& txout) const
1094
1094
CAmount CWallet::GetCredit (const CTxOut& txout, const isminefilter& filter) const
1095
1095
{
1096
1096
if (!MoneyRange (txout.nValue ))
1097
- throw std::runtime_error (" CWallet::GetCredit() : value out of range" );
1097
+ throw std::runtime_error (std::string (__func__) + " : value out of range" );
1098
1098
return ((IsMine (txout) & filter) ? txout.nValue : 0 );
1099
1099
}
1100
1100
@@ -1123,7 +1123,7 @@ bool CWallet::IsChange(const CTxOut& txout) const
1123
1123
CAmount CWallet::GetChange (const CTxOut& txout) const
1124
1124
{
1125
1125
if (!MoneyRange (txout.nValue ))
1126
- throw std::runtime_error (" CWallet::GetChange() : value out of range" );
1126
+ throw std::runtime_error (std::string (__func__) + " : value out of range" );
1127
1127
return (IsChange (txout) ? txout.nValue : 0 );
1128
1128
}
1129
1129
@@ -1147,7 +1147,7 @@ CAmount CWallet::GetDebit(const CTransaction& tx, const isminefilter& filter) co
1147
1147
{
1148
1148
nDebit += GetDebit (txin, filter);
1149
1149
if (!MoneyRange (nDebit))
1150
- throw std::runtime_error (" CWallet::GetDebit() : value out of range" );
1150
+ throw std::runtime_error (std::string (__func__) + " : value out of range" );
1151
1151
}
1152
1152
return nDebit;
1153
1153
}
@@ -1159,7 +1159,7 @@ CAmount CWallet::GetCredit(const CTransaction& tx, const isminefilter& filter) c
1159
1159
{
1160
1160
nCredit += GetCredit (txout, filter);
1161
1161
if (!MoneyRange (nCredit))
1162
- throw std::runtime_error (" CWallet::GetCredit() : value out of range" );
1162
+ throw std::runtime_error (std::string (__func__) + " : value out of range" );
1163
1163
}
1164
1164
return nCredit;
1165
1165
}
@@ -1171,7 +1171,7 @@ CAmount CWallet::GetChange(const CTransaction& tx) const
1171
1171
{
1172
1172
nChange += GetChange (txout);
1173
1173
if (!MoneyRange (nChange))
1174
- throw std::runtime_error (" CWallet::GetChange() : value out of range" );
1174
+ throw std::runtime_error (std::string (__func__) + " : value out of range" );
1175
1175
}
1176
1176
return nChange;
1177
1177
}
@@ -1200,7 +1200,7 @@ CPubKey CWallet::GenerateNewHDMasterKey()
1200
1200
1201
1201
// write the key&metadata to the database
1202
1202
if (!AddKeyPubKey (key, pubkey))
1203
- throw std::runtime_error (std::string (__func__)+ " : AddKeyPubKey failed" );
1203
+ throw std::runtime_error (std::string (__func__) + " : AddKeyPubKey failed" );
1204
1204
}
1205
1205
1206
1206
return pubkey;
@@ -1227,7 +1227,7 @@ bool CWallet::SetHDChain(const CHDChain& chain, bool memonly)
1227
1227
{
1228
1228
LOCK (cs_wallet);
1229
1229
if (!memonly && !CWalletDB (strWalletFile).WriteHDChain (chain))
1230
- throw runtime_error (" AddHDChain() : writing chain failed" );
1230
+ throw runtime_error (std::string (__func__) + " : writing chain failed" );
1231
1231
1232
1232
hdChain = chain;
1233
1233
return true ;
@@ -2706,7 +2706,7 @@ bool CWallet::TopUpKeyPool(unsigned int kpSize)
2706
2706
if (!setKeyPool.empty ())
2707
2707
nEnd = *(--setKeyPool.end ()) + 1 ;
2708
2708
if (!walletdb.WritePool (nEnd, CKeyPool (GenerateNewKey ())))
2709
- throw runtime_error (" TopUpKeyPool() : writing generated key failed" );
2709
+ throw runtime_error (std::string (__func__) + " : writing generated key failed" );
2710
2710
setKeyPool.insert (nEnd);
2711
2711
LogPrintf (" keypool added key %d, size=%u\n " , nEnd, setKeyPool.size ());
2712
2712
}
@@ -2733,9 +2733,9 @@ void CWallet::ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool)
2733
2733
nIndex = *(setKeyPool.begin ());
2734
2734
setKeyPool.erase (setKeyPool.begin ());
2735
2735
if (!walletdb.ReadPool (nIndex, keypool))
2736
- throw runtime_error (" ReserveKeyFromKeyPool() : read failed" );
2736
+ throw runtime_error (std::string (__func__) + " : read failed" );
2737
2737
if (!HaveKey (keypool.vchPubKey .GetID ()))
2738
- throw runtime_error (" ReserveKeyFromKeyPool() : unknown key in key pool" );
2738
+ throw runtime_error (std::string (__func__) + " : unknown key in key pool" );
2739
2739
assert (keypool.vchPubKey .IsValid ());
2740
2740
LogPrintf (" keypool reserve %d\n " , nIndex);
2741
2741
}
@@ -2794,7 +2794,7 @@ int64_t CWallet::GetOldestKeyPoolTime()
2794
2794
CWalletDB walletdb (strWalletFile);
2795
2795
int64_t nIndex = *(setKeyPool.begin ());
2796
2796
if (!walletdb.ReadPool (nIndex, keypool))
2797
- throw runtime_error (" GetOldestKeyPoolTime() : read oldest key in keypool failed" );
2797
+ throw runtime_error (std::string (__func__) + " : read oldest key in keypool failed" );
2798
2798
assert (keypool.vchPubKey .IsValid ());
2799
2799
return keypool.nTime ;
2800
2800
}
@@ -3021,11 +3021,11 @@ void CWallet::GetAllReserveKeys(set<CKeyID>& setAddress) const
3021
3021
{
3022
3022
CKeyPool keypool;
3023
3023
if (!walletdb.ReadPool (id, keypool))
3024
- throw runtime_error (" GetAllReserveKeyHashes() : read failed" );
3024
+ throw runtime_error (std::string (__func__) + " : read failed" );
3025
3025
assert (keypool.vchPubKey .IsValid ());
3026
3026
CKeyID keyID = keypool.vchPubKey .GetID ();
3027
3027
if (!HaveKey (keyID))
3028
- throw runtime_error (" GetAllReserveKeyHashes() : unknown key in key pool" );
3028
+ throw runtime_error (std::string (__func__) + " : unknown key in key pool" );
3029
3029
setAddress.insert (keyID);
3030
3030
}
3031
3031
}
@@ -3325,7 +3325,7 @@ bool CWallet::InitLoadWallet()
3325
3325
// generate a new master key
3326
3326
CPubKey masterPubKey = walletInstance->GenerateNewHDMasterKey ();
3327
3327
if (!walletInstance->SetHDMasterKey (masterPubKey))
3328
- throw std::runtime_error (" CWallet::GenerateNewKey() : Storing master key failed" );
3328
+ throw std::runtime_error (std::string (__func__) + " : Storing master key failed" );
3329
3329
}
3330
3330
CPubKey newDefaultKey;
3331
3331
if (walletInstance->GetKeyFromPool (newDefaultKey)) {
0 commit comments