Skip to content

Commit

Permalink
Merge pull request #295 from Bucko13/segwit-keyring
Browse files Browse the repository at this point in the history
pass options on keyring creation
  • Loading branch information
chjj authored Oct 19, 2017
2 parents 340f217 + ed4e7b1 commit a4858e2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/primitives/keyring.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;

Expand Down

0 comments on commit a4858e2

Please sign in to comment.