Skip to content

Commit

Permalink
name_new : change generation of random number
Browse files Browse the repository at this point in the history
  • Loading branch information
khalahan committed Jun 11, 2012
1 parent e611ad6 commit 82c140e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/namecoin.cpp
Expand Up @@ -1204,7 +1204,10 @@ Value name_new(const Array& params, bool fHelp)
wtx.nVersion = NAMECOIN_TX_VERSION;

uint64 rand = GetRand((uint64)-1);
vector<unsigned char> vchRand = CBigNum(rand).getvch();
vector<unsigned char> seedRand = CBigNum(rand).getvch();
string strRand = Hash(seedRand.begin(), seedRand.end()).ToString();
strRand.resize(16);
vector<unsigned char> vchRand = ParseHex(strRand);
vector<unsigned char> vchToHash(vchRand);
vchToHash.insert(vchToHash.end(), vchName.begin(), vchName.end());
uint160 hash = Hash160(vchToHash);
Expand Down

0 comments on commit 82c140e

Please sign in to comment.