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

Commit

Permalink
Merge pull request #326 from matiu/v4.2
Browse files Browse the repository at this point in the history
v4.2
  • Loading branch information
matiu authored Sep 2, 2016
2 parents 4014bb2 + 8e04f9b commit 989742e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
21 changes: 20 additions & 1 deletion bitcore-wallet-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,25 @@ API.prototype.getKeys = function(password) {
return this.credentials.getKeys(password);
};


/**
* Checks is password is valid
* Returns null (keys not encrypted), true or false.
*
* @param password
*/
API.prototype.checkPassword = function(password) {
if (!this.isPrivKeyEncrypted()) return;

try {
var keys = this.getKeys(password);
return !!keys.xPrivKey;
} catch (e) {
return false;
};
};


/**
* Can this credentials sign a transaction?
* (Only returns fail on a 'proxy' setup for airgapped operation)
Expand Down Expand Up @@ -123395,7 +123414,7 @@ module.exports={
"name": "bitcore-wallet-client",
"description": "Client for bitcore-wallet-service",
"author": "BitPay Inc",
"version": "4.1.0",
"version": "4.2.0",
"license": "MIT",
"keywords": [
"bitcoin",
Expand Down
Loading

0 comments on commit 989742e

Please sign in to comment.