git://git.novaco.in
/
novacoin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
09f2a99
)
PPCoin: RPC 'makekeypair' limits loop to avoid hang
author
Sunny King
<sunnyking9999@gmail.com>
Thu, 12 Jul 2012 15:27:55 +0000 (16:27 +0100)
committer
Sunny King
<sunnyking9999@gmail.com>
Thu, 12 Jul 2012 15:27:55 +0000 (16:27 +0100)
src/bitcoinrpc.cpp
patch
|
blob
|
history
diff --git
a/src/bitcoinrpc.cpp
b/src/bitcoinrpc.cpp
index
60c5449
..
70b608a
100644
(file)
--- a/
src/bitcoinrpc.cpp
+++ b/
src/bitcoinrpc.cpp
@@
-1923,10
+1923,15
@@
Value makekeypair(const Array& params, bool fHelp)
strPrefix = params[0].get_str();
CKey key;
+ int nCount = 0;
do
{
key.MakeNewKey();
- } while (strPrefix != HexStr(key.GetPubKey()).substr(0, strPrefix.size()));
+ nCount++;
+ } while (nCount < 10000 && strPrefix != HexStr(key.GetPubKey()).substr(0, strPrefix.size()));
+
+ if (strPrefix != HexStr(key.GetPubKey()).substr(0, strPrefix.size()))
+ return Value::null;
CPrivKey vchPrivKey = key.GetPrivKey();
Object result;