Compare commits

...

2 Commits

Author SHA1 Message Date
MoneroOcean e6143eb9c0 Fixed KCN blob contruction in all cases 2024-06-02 20:40:12 +03:00
MoneroOcean 1b2f6af8f8 Fixed KCN blob contruction in all cases 2024-06-02 20:23:32 +03:00
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ function transaction_hash3(transaction, forWitness) {
function getMerkleRoot(transactions, transaction_hash_func) {
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 rootHash = fastMerkleRoot(hashes, hash256);
return forWitness ? hash256_3(Buffer.concat([rootHash, transactions[0].ins[0].witness[0]])) : rootHash;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cryptoforknote-util",
"version": "15.3.15",
"version": "15.3.17",
"author": {
"name": "LucasJones",
"email": "lucasjonesdev@hotmail.co.uk"
+3 -3
View File
@@ -240,7 +240,7 @@ module.exports.RtmBlockTemplate = function(rpcData, poolAddress) {
const scriptSigPart2 = serializeString('/nodeStratum/');
const is_witness = false; //rpcData.default_witness_commitment !== undefined;
const is_witness = false;//rpcData.default_witness_commitment !== undefined;
const blob1 = Buffer.concat([
coinbaseVersion,
@@ -281,7 +281,7 @@ module.exports.RtmBlockTemplate = function(rpcData, poolAddress) {
// tx input scripts instead of size of script part so not sure how to parse them
// just drop them for now
// example: https://explorer.raptoreum.com/tx/1461d70fa8362b0896e2e9be6312521f2684f22c9b0f9152695f33f67d9f9d3f
rpcData.transactions.forEach(function(tx) {
/*rpcData.transactions.forEach(function(tx) {
if (tx.version != 1) {
try {
bitcoin.Transaction.fromBuffer(Buffer.from(tx.data, 'hex'), false, false);
@@ -293,7 +293,7 @@ module.exports.RtmBlockTemplate = function(rpcData, poolAddress) {
} else {
console.error("Skip RTM v1 tx: " + tx.data);
}
});
});*/
const txn = varIntBuffer(txs.length + 1);
return {