From 92f2edbf651ed629331241e5db4b643324c3aec4 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Thu, 24 Apr 2014 15:39:07 -0300 Subject: [PATCH 1/2] Function getRandomId: Fix creating new wallet --- js/models/core/Wallet.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index fdbfe36ee..70e01c0af 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -39,8 +39,7 @@ Wallet.prototype.log = function(){ }; Wallet.getRandomId = function() { - var r = buffertools.toHex(coinUtil.generateNonce()); - return r; + return bitcore.SecureRandom.getPseudoRandomBuffer(8); }; Wallet.prototype._handlePublicKeyRing = function(senderId, data, isInbound) { From 5fb32c41b25f16462985326c1195ce8ab2da9145 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Thu, 24 Apr 2014 15:49:37 -0300 Subject: [PATCH 2/2] Fix return --- js/models/core/Wallet.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index 70e01c0af..975a98314 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -39,7 +39,8 @@ Wallet.prototype.log = function(){ }; Wallet.getRandomId = function() { - return bitcore.SecureRandom.getPseudoRandomBuffer(8); + var r = bitcore.SecureRandom.getPseudoRandomBuffer(8).toString('hex'); + return r; }; Wallet.prototype._handlePublicKeyRing = function(senderId, data, isInbound) {