You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is totally wrong for cases 3-5 and block with this encoding in Transaction Count field will be rejected with block decode failed error. Should be:
if (this.txCount <= 0x7f){
var varInt = new Buffer(txCount, 'hex');
}
else if (this.txCount <= 0x7fff){
if (txCount.length == 2) txCount = "00" + txCount;
var varInt = new Buffer.concat([Buffer('FD', 'hex'), util.reverseBuffer(new Buffer(txCount, 'hex'))]);
}
The text was updated successfully, but these errors were encountered:
/* https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer */
if (this.txCount < 0xfd){
var varInt = new Buffer(txCount, 'hex');
}
else if (this.txCount <= 0xffff){
var varInt = new Buffer.concat([Buffer('FD', 'hex'), util.reverseBuffer(new Buffer(txCount, 'hex'))]);
}
We have wrong varint encoding here https://github.com/z-classic/node-stratum-pool/blob/master/lib/blockTemplate.js#L91 for transaction count in block. Let's see results of default implementation:
This is totally wrong for cases 3-5 and block with this encoding in Transaction Count field will be rejected with
block decode failed
error. Should be:Here is a fix:
The text was updated successfully, but these errors were encountered: