do not copy scripts.
This commit is contained in:
parent
6ad3540664
commit
c312905585
@ -35,13 +35,14 @@ function Input(options) {
|
|||||||
if (Buffer.isBuffer(this.prevout.hash))
|
if (Buffer.isBuffer(this.prevout.hash))
|
||||||
this.prevout.hash = utils.toHex(this.prevout.hash);
|
this.prevout.hash = utils.toHex(this.prevout.hash);
|
||||||
|
|
||||||
this.script = options.script ? options.script.slice() : [];
|
// this.script = options.script ? options.script.slice() : [];
|
||||||
|
this.script = options.script || [];
|
||||||
this.sequence = options.sequence == null ? 0xffffffff : options.sequence;
|
this.sequence = options.sequence == null ? 0xffffffff : options.sequence;
|
||||||
this._size = options._size || 0;
|
this._size = options._size || 0;
|
||||||
this._offset = options._offset || 0;
|
this._offset = options._offset || 0;
|
||||||
|
|
||||||
if (options.script && options.script._raw)
|
// if (options.script && options.script._raw)
|
||||||
utils.hidden(this.script, '_raw', options.script._raw);
|
// utils.hidden(this.script, '_raw', options.script._raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
Input.prototype.__defineGetter__('data', function() {
|
Input.prototype.__defineGetter__('data', function() {
|
||||||
|
|||||||
@ -24,11 +24,14 @@ function Output(options) {
|
|||||||
|
|
||||||
value = options.value;
|
value = options.value;
|
||||||
|
|
||||||
if (typeof value === 'number' && (value | 0) === value)
|
if (typeof value === 'number') {
|
||||||
|
assert(value % 1 === 0);
|
||||||
value = new bn(value);
|
value = new bn(value);
|
||||||
|
}
|
||||||
|
|
||||||
this.value = utils.satoshi(value || new bn(0));
|
this.value = utils.satoshi(value || new bn(0));
|
||||||
this.script = options.script ? options.script.slice() : [];
|
// this.script = options.script ? options.script.slice() : [];
|
||||||
|
this.script = options.script || [];
|
||||||
this._size = options._size || 0;
|
this._size = options._size || 0;
|
||||||
this._offset = options._offset || 0;
|
this._offset = options._offset || 0;
|
||||||
|
|
||||||
@ -39,8 +42,8 @@ function Output(options) {
|
|||||||
assert(this.value.bitLength() <= 63);
|
assert(this.value.bitLength() <= 63);
|
||||||
assert(!(this.value.toArray('be', 8)[0] & 0x80));
|
assert(!(this.value.toArray('be', 8)[0] & 0x80));
|
||||||
|
|
||||||
if (options.script && options.script._raw)
|
// if (options.script && options.script._raw)
|
||||||
utils.hidden(this.script, '_raw', options.script._raw);
|
// utils.hidden(this.script, '_raw', options.script._raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
Output.prototype.__defineGetter__('data', function() {
|
Output.prototype.__defineGetter__('data', function() {
|
||||||
|
|||||||
@ -972,6 +972,8 @@ TX.prototype.getInputs = function getInputs(unspent, options) {
|
|||||||
var i, size, newkb, change;
|
var i, size, newkb, change;
|
||||||
var fee;
|
var fee;
|
||||||
|
|
||||||
|
assert(tx.inputs.length === 0);
|
||||||
|
|
||||||
if (!options || typeof options !== 'object') {
|
if (!options || typeof options !== 'object') {
|
||||||
options = {
|
options = {
|
||||||
changeAddress: arguments[1],
|
changeAddress: arguments[1],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user