Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Commit 989742e

Browse files
authored
Merge pull request #326 from matiu/v4.2
v4.2
2 parents 4014bb2 + 8e04f9b commit 989742e

File tree

3 files changed

+29
-10
lines changed

3 files changed

+29
-10
lines changed

bitcore-wallet-client.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,25 @@ API.prototype.getKeys = function(password) {
10761076
return this.credentials.getKeys(password);
10771077
};
10781078

1079+
1080+
/**
1081+
* Checks is password is valid
1082+
* Returns null (keys not encrypted), true or false.
1083+
*
1084+
* @param password
1085+
*/
1086+
API.prototype.checkPassword = function(password) {
1087+
if (!this.isPrivKeyEncrypted()) return;
1088+
1089+
try {
1090+
var keys = this.getKeys(password);
1091+
return !!keys.xPrivKey;
1092+
} catch (e) {
1093+
return false;
1094+
};
1095+
};
1096+
1097+
10791098
/**
10801099
* Can this credentials sign a transaction?
10811100
* (Only returns fail on a 'proxy' setup for airgapped operation)
@@ -123395,7 +123414,7 @@ module.exports={
123395123414
"name": "bitcore-wallet-client",
123396123415
"description": "Client for bitcore-wallet-service",
123397123416
"author": "BitPay Inc",
123398-
"version": "4.1.0",
123417+
"version": "4.2.0",
123399123418
"license": "MIT",
123400123419
"keywords": [
123401123420
"bitcoin",

0 commit comments

Comments
 (0)