fix issue with mutable scripts.
This commit is contained in:
parent
f013ddb353
commit
d4f03f982e
@ -32,7 +32,7 @@ var BufferWriter = require('./writer');
|
||||
|
||||
function Input(options, mutable) {
|
||||
if (!(this instanceof Input))
|
||||
return new Input(options);
|
||||
return new Input(options, mutable);
|
||||
|
||||
assert(options, 'Input data is required.');
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ function Output(options, mutable) {
|
||||
var value;
|
||||
|
||||
if (!(this instanceof Output))
|
||||
return new Output(options);
|
||||
return new Output(options, mutable);
|
||||
|
||||
assert(options, 'Output data is required.');
|
||||
|
||||
@ -43,7 +43,7 @@ function Output(options, mutable) {
|
||||
this.script = bcoin.script(options.script, this.mutable);
|
||||
|
||||
assert(typeof this.value === 'number');
|
||||
assert(!this.mutable || this.value > 0);
|
||||
assert(!this.mutable || this.value >= 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -39,7 +39,7 @@ function Witness(items, mutable) {
|
||||
}
|
||||
|
||||
if (!(this instanceof Witness))
|
||||
return new Witness(items);
|
||||
return new Witness(items, mutable);
|
||||
|
||||
this.mutable = !!mutable;
|
||||
|
||||
@ -818,7 +818,7 @@ function Script(code, mutable) {
|
||||
}
|
||||
|
||||
if (!(this instanceof Script))
|
||||
return new Script(code);
|
||||
return new Script(code, mutable);
|
||||
|
||||
this.mutable = !!mutable;
|
||||
|
||||
|
||||
@ -40,6 +40,7 @@ describe('Chain', function() {
|
||||
value: utils.satoshi('25.0')
|
||||
});
|
||||
redeemer.addInput(tx, 0);
|
||||
redeemer.setLocktime(chain.height);
|
||||
wallet.sign(redeemer);
|
||||
attempt.addTX(redeemer);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user