bug fix
- Fixed: Invalid private key on signing in error not working correctly and cause other bugs
This commit is contained in:
parent
5e8f0dddb5
commit
9b7dd8214d
@ -7234,7 +7234,7 @@ Bitcoin.Util = {
|
|||||||
var floID = key.getBitcoinAddress();
|
var floID = key.getBitcoinAddress();
|
||||||
return floID;
|
return floID;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
return null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -8957,16 +8957,15 @@ Bitcoin.Util = {
|
|||||||
} else {
|
} else {
|
||||||
var privKey;
|
var privKey;
|
||||||
inputFn("PRIVATE_KEY").then(result => {
|
inputFn("PRIVATE_KEY").then(result => {
|
||||||
try {
|
if (!result)
|
||||||
if (!result)
|
return reject("Empty Private Key")
|
||||||
return reject("Empty Private Key")
|
var pubKey = floCrypto.getPubKeyHex(result)
|
||||||
var floID = floCrypto.getFloIDfromPubkeyHex(
|
if(!pubKey)
|
||||||
floCrypto.getPubKeyHex(result))
|
|
||||||
privKey = result
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error)
|
|
||||||
return reject("Invalid Private Key")
|
return reject("Invalid Private Key")
|
||||||
}
|
var floID = floCrypto.getFloIDfromPubkeyHex(pubKey)
|
||||||
|
if(!floID || !floCrypto.validateAddr(floID))
|
||||||
|
return reject("Invalid Private Key")
|
||||||
|
privKey = result;
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.log(error, "Generating Random Keys")
|
console.log(error, "Generating Random Keys")
|
||||||
privKey = floCrypto.generateNewID().privKey
|
privKey = floCrypto.generateNewID().privKey
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user