implement and use txOut.scriptPubKey
This commit is contained in:
parent
5d79b094d4
commit
3d12d3b038
3 changed files with 24 additions and 4 deletions
|
@ -433,8 +433,7 @@ var TransactionOut = function (data) {
|
|||
: data.value;
|
||||
};
|
||||
|
||||
TransactionOut.prototype.clone = function ()
|
||||
{
|
||||
TransactionOut.prototype.clone = function() {
|
||||
var newTxout = new TransactionOut({
|
||||
script: this.script.clone(),
|
||||
value: this.value
|
||||
|
@ -442,6 +441,10 @@ TransactionOut.prototype.clone = function ()
|
|||
return newTxout;
|
||||
};
|
||||
|
||||
TransactionOut.prototype.scriptPubKey = function() {
|
||||
return convert.bytesToHex(this.script.buffer)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
Transaction: Transaction,
|
||||
TransactionIn: TransactionIn,
|
||||
|
|
|
@ -146,7 +146,7 @@ var Wallet = function (seed, options) {
|
|||
receive: output,
|
||||
value: txOut.value,
|
||||
address: address,
|
||||
scriptPubKey: convert.bytesToHex(txOut.script.buffer) //TODO: txOut.scriptPubKey()
|
||||
scriptPubKey: txOut.scriptPubKey()
|
||||
// timestamp: new Date().getTime() / 1000,
|
||||
// pending: true
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue