Merge pull request #295 from Bucko13/segwit-keyring

pass options on keyring creation
This commit is contained in:
Christopher Jeffrey (JJ) 2017-10-18 22:40:08 -07:00 committed by GitHub
commit a4858e274b

View File

@ -63,6 +63,16 @@ KeyRing.prototype.fromOptions = function fromOptions(options, network) {
let key = toKey(options);
if (options.witness != null) {
assert(typeof options.witness === 'boolean');
this.witness = options.witness;
}
if (options.nested != null) {
assert(typeof options.nested === 'boolean');
this.nested = options.nested;
}
if (Buffer.isBuffer(key))
return this.fromKey(key, network);
@ -74,16 +84,6 @@ KeyRing.prototype.fromOptions = function fromOptions(options, network) {
if (options.privateKey)
key = toKey(options.privateKey);
if (options.witness != null) {
assert(typeof options.witness === 'boolean');
this.witness = options.witness;
}
if (options.nested != null) {
assert(typeof options.nested === 'boolean');
this.nested = options.nested;
}
const script = options.script;
const compress = options.compressed;