Merge pull request #295 from Bucko13/segwit-keyring
pass options on keyring creation
This commit is contained in:
commit
a4858e274b
@ -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;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user