@@ -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 ;
@@ -2712,7 +2712,7 @@ bool CWallet::TopUpKeyPool(unsigned int kpSize)
2712
2712
if (!setKeyPool.empty ())
2713
2713
nEnd = *(--setKeyPool.end ()) + 1 ;
2714
2714
if (!walletdb.WritePool (nEnd, CKeyPool (GenerateNewKey ())))
2715
- throw runtime_error (" TopUpKeyPool() : writing generated key failed" );
2715
+ throw runtime_error (std::string (__func__) + " : writing generated key failed" );
2716
2716
setKeyPool.insert (nEnd);
2717
2717
LogPrintf (" keypool added key %d, size=%u\n " , nEnd, setKeyPool.size ());
2718
2718
}
@@ -2739,9 +2739,9 @@ void CWallet::ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool)
2739
2739
nIndex = *(setKeyPool.begin ());
2740
2740
setKeyPool.erase (setKeyPool.begin ());
2741
2741
if (!walletdb.ReadPool (nIndex, keypool))
2742
- throw runtime_error (" ReserveKeyFromKeyPool() : read failed" );
2742
+ throw runtime_error (std::string (__func__) + " : read failed" );
2743
2743
if (!HaveKey (keypool.vchPubKey .GetID ()))
2744
- throw runtime_error (" ReserveKeyFromKeyPool() : unknown key in key pool" );
2744
+ throw runtime_error (std::string (__func__) + " : unknown key in key pool" );
2745
2745
assert (keypool.vchPubKey .IsValid ());
2746
2746
LogPrintf (" keypool reserve %d\n " , nIndex);
2747
2747
}
@@ -2800,7 +2800,7 @@ int64_t CWallet::GetOldestKeyPoolTime()
2800
2800
CWalletDB walletdb (strWalletFile);
2801
2801
int64_t nIndex = *(setKeyPool.begin ());
2802
2802
if (!walletdb.ReadPool (nIndex, keypool))
2803
- throw runtime_error (" GetOldestKeyPoolTime() : read oldest key in keypool failed" );
2803
+ throw runtime_error (std::string (__func__) + " : read oldest key in keypool failed" );
2804
2804
assert (keypool.vchPubKey .IsValid ());
2805
2805
return keypool.nTime ;
2806
2806
}
@@ -3027,11 +3027,11 @@ void CWallet::GetAllReserveKeys(set<CKeyID>& setAddress) const
3027
3027
{
3028
3028
CKeyPool keypool;
3029
3029
if (!walletdb.ReadPool (id, keypool))
3030
- throw runtime_error (" GetAllReserveKeyHashes() : read failed" );
3030
+ throw runtime_error (std::string (__func__) + " : read failed" );
3031
3031
assert (keypool.vchPubKey .IsValid ());
3032
3032
CKeyID keyID = keypool.vchPubKey .GetID ();
3033
3033
if (!HaveKey (keyID))
3034
- throw runtime_error (" GetAllReserveKeyHashes() : unknown key in key pool" );
3034
+ throw runtime_error (std::string (__func__) + " : unknown key in key pool" );
3035
3035
setAddress.insert (keyID);
3036
3036
}
3037
3037
}
@@ -3331,7 +3331,7 @@ bool CWallet::InitLoadWallet()
3331
3331
// generate a new master key
3332
3332
CPubKey masterPubKey = walletInstance->GenerateNewHDMasterKey ();
3333
3333
if (!walletInstance->SetHDMasterKey (masterPubKey))
3334
- throw std::runtime_error (" CWallet::GenerateNewKey() : Storing master key failed" );
3334
+ throw std::runtime_error (std::string (__func__) + " : Storing master key failed" );
3335
3335
}
3336
3336
CPubKey newDefaultKey;
3337
3337
if (walletInstance->GetKeyFromPool (newDefaultKey)) {
0 commit comments