From 8652959e54bba09554fb62dc4e77363ed56c08dd Mon Sep 17 00:00:00 2001 From: sairajzero Date: Wed, 4 Mar 2020 03:45:50 +0530 Subject: [PATCH] floCrypto: errorHanding errorHanding added to floCrypto.getPubKeyHex and floCrypto.getFloIDfromPubkeyHex --- standard_Operations.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/standard_Operations.html b/standard_Operations.html index b89f82c..cd8b871 100644 --- a/standard_Operations.html +++ b/standard_Operations.html @@ -7214,7 +7214,7 @@ Bitcoin.Util = { getPubKeyHex: function (privateKeyHex) { var key = new Bitcoin.ECKey(privateKeyHex); if (key.priv == null) { - alert("Invalid Private key"); + console.error("Invalid Private key"); return; } key.setCompressed(true); @@ -7224,9 +7224,13 @@ Bitcoin.Util = { //Returns flo-ID from public-key getFloIDfromPubkeyHex: function (pubkeyHex) { - var key = new Bitcoin.ECKey().setPub(pubkeyHex); - var floID = key.getBitcoinAddress(); - return floID; + try{ + var key = new Bitcoin.ECKey().setPub(pubkeyHex); + var floID = key.getBitcoinAddress(); + return floID; + }catch (e) { + console.error(e); + } }, //Verify the private-key for the given public-key or flo-ID