mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
Fixed issue where if script ended in 00's it would not put nonces in correct position
This commit is contained in:
@@ -92,7 +92,9 @@ export class MiningJob {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set the nonces
|
// set the nonces
|
||||||
testBlock.transactions[0].ins[0].script = Buffer.from(testBlock.transactions[0].ins[0].script.toString('hex').replace('0000000000000000', `${extraNonce}${extraNonce2}`), 'hex');
|
const nonceFreeScript = testBlock.transactions[0].ins[0].script.toString('hex');
|
||||||
|
|
||||||
|
testBlock.transactions[0].ins[0].script = Buffer.from(`${nonceFreeScript.substring(0, nonceFreeScript.length - 16)}${extraNonce}${extraNonce2}`, 'hex');
|
||||||
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
//recompute the root
|
//recompute the root
|
||||||
|
|||||||
Reference in New Issue
Block a user