make data easier to extract from inputs and outputs.
This commit is contained in:
parent
a6e3024e9b
commit
eb6a9fc20d
@ -112,9 +112,15 @@ TX.prototype._input = function _input(i, index) {
|
||||
tx: (i.out ? i.out.tx : i.tx) || null,
|
||||
hash: utils.toHex(hash),
|
||||
index: i.out ? i.out.index : i.index,
|
||||
get rhash() {
|
||||
return utils.revHex(input.out.hash);
|
||||
}
|
||||
},
|
||||
script: i.script ? i.script.slice() : [],
|
||||
seq: i.seq === undefined ? 0xffffffff : i.seq
|
||||
seq: i.seq === undefined ? 0xffffffff : i.seq,
|
||||
get data() {
|
||||
return TX.getInputData(input);
|
||||
}
|
||||
};
|
||||
|
||||
if (i.script && i.script._raw)
|
||||
@ -433,7 +439,10 @@ TX.prototype.output = function output(options, value) {
|
||||
|
||||
var output = {
|
||||
value: new bn(options.value),
|
||||
script: options.script ? options.script.slice() : []
|
||||
script: options.script ? options.script.slice() : [],
|
||||
get data() {
|
||||
return TX.getOutputData(output);
|
||||
}
|
||||
};
|
||||
|
||||
if (options.script && options.script._raw)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user