keyring: add refresh method.

This commit is contained in:
Christopher Jeffrey 2016-12-18 20:41:30 -08:00
parent 97ecd5c59f
commit 37a3f83334
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -105,6 +105,21 @@ KeyRing.fromOptions = function fromOptions(options) {
return new KeyRing().fromOptions(options);
};
/**
* Clear cached key/script hashes.
*/
KeyRing.prototype.refresh = function refresh() {
this._keyHash = null;
this._keyAddress = null;
this._program = null;
this._nestedHash = null;
this._nestedAddress = null;
this._scriptHash160 = null;
this._scriptHash256 = null;
this._scriptAddress = null;
};
/**
* Inject data from private key.
* @private
@ -724,8 +739,8 @@ KeyRing.prototype.verify = function verify(msg, sig) {
};
/**
* Get script type.
* @returns {ScriptType}
* Get witness program version.
* @returns {Number}
*/
KeyRing.prototype.getVersion = function getVersion() {