mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2025-03-18 05:41:43 +01:00
ensure deep copy
This commit is contained in:
parent
9421b72064
commit
b4fff2b7af
@ -61,6 +61,9 @@ export class MiningJob {
|
||||
public copyAndUpdateBlock(jobTemplate: IJobTemplate, versionMask: number, nonce: number, extraNonce: string, extraNonce2: string, timestamp: number): bitcoinjs.Block {
|
||||
|
||||
const testBlock = Object.assign(new bitcoinjs.Block(), jobTemplate.block);
|
||||
testBlock.transactions = jobTemplate.block.transactions.map(tx => {
|
||||
return Object.assign(new bitcoinjs.Transaction(), tx);
|
||||
});
|
||||
|
||||
testBlock.transactions[0] = this.coinbaseTransaction;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user