segwit support

Use tx ID if it exists, else continue to use tx hash
This commit is contained in:
jonnybravo0311 2016-12-11 15:13:59 -05:00 committed by Matthew Little
parent 1b8c7086be
commit 7894c4713e

View File

@ -23,6 +23,9 @@ var BlockTemplate = module.exports = function BlockTemplate(jobId, rpcData, pool
function getTransactionBuffers(txs){
var txHashes = txs.map(function(tx){
if (tx.txid !== undefined) {
return util.uint256BufferFromHash(tx.txid);
}
return util.uint256BufferFromHash(tx.hash);
});
return [null].concat(txHashes);
@ -136,4 +139,4 @@ var BlockTemplate = module.exports = function BlockTemplate(jobId, rpcData, pool
}
return this.jobParams;
};
};
};