Fixed KCN blob contruction in all cases
This commit is contained in:
2
index.js
2
index.js
@@ -66,7 +66,7 @@ function transaction_hash3(transaction, forWitness) {
|
|||||||
|
|
||||||
function getMerkleRoot(transactions, transaction_hash_func) {
|
function getMerkleRoot(transactions, transaction_hash_func) {
|
||||||
if (transactions.length === 0) return Buffer.from('0000000000000000000000000000000000000000000000000000000000000000', 'hex')
|
if (transactions.length === 0) return Buffer.from('0000000000000000000000000000000000000000000000000000000000000000', 'hex')
|
||||||
const forWitness = txesHaveWitnessCommit(transactions);
|
const forWitness = false;//txesHaveWitnessCommit(transactions);
|
||||||
const hashes = transactions.map(transaction => transaction_hash_func(transaction, forWitness));
|
const hashes = transactions.map(transaction => transaction_hash_func(transaction, forWitness));
|
||||||
const rootHash = fastMerkleRoot(hashes, hash256);
|
const rootHash = fastMerkleRoot(hashes, hash256);
|
||||||
return forWitness ? hash256_3(Buffer.concat([rootHash, transactions[0].ins[0].witness[0]])) : rootHash;
|
return forWitness ? hash256_3(Buffer.concat([rootHash, transactions[0].ins[0].witness[0]])) : rootHash;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cryptoforknote-util",
|
"name": "cryptoforknote-util",
|
||||||
"version": "15.3.15",
|
"version": "15.3.16",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "LucasJones",
|
"name": "LucasJones",
|
||||||
"email": "lucasjonesdev@hotmail.co.uk"
|
"email": "lucasjonesdev@hotmail.co.uk"
|
||||||
|
|||||||
2
rtm.js
2
rtm.js
@@ -240,7 +240,7 @@ module.exports.RtmBlockTemplate = function(rpcData, poolAddress) {
|
|||||||
|
|
||||||
const scriptSigPart2 = serializeString('/nodeStratum/');
|
const scriptSigPart2 = serializeString('/nodeStratum/');
|
||||||
|
|
||||||
const is_witness = false; //rpcData.default_witness_commitment !== undefined;
|
const is_witness = rpcData.default_witness_commitment !== undefined;
|
||||||
|
|
||||||
const blob1 = Buffer.concat([
|
const blob1 = Buffer.concat([
|
||||||
coinbaseVersion,
|
coinbaseVersion,
|
||||||
|
|||||||
Reference in New Issue
Block a user