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,
|
tx: (i.out ? i.out.tx : i.tx) || null,
|
||||||
hash: utils.toHex(hash),
|
hash: utils.toHex(hash),
|
||||||
index: i.out ? i.out.index : i.index,
|
index: i.out ? i.out.index : i.index,
|
||||||
|
get rhash() {
|
||||||
|
return utils.revHex(input.out.hash);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
script: i.script ? i.script.slice() : [],
|
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)
|
if (i.script && i.script._raw)
|
||||||
@ -433,7 +439,10 @@ TX.prototype.output = function output(options, value) {
|
|||||||
|
|
||||||
var output = {
|
var output = {
|
||||||
value: new bn(options.value),
|
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)
|
if (options.script && options.script._raw)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user