Skip to content
Snippets Groups Projects
Commit 52f8012c authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] #1079 Incorrect passing of the configuration to PoW engine

parent 388d373b
No related branches found
No related tags found
No related merge requests found
...@@ -168,7 +168,12 @@ export class BlockProver { ...@@ -168,7 +168,12 @@ export class BlockProver {
this.logger.info('Generating proof-of-work with %s leading zeros followed by [0-' + highMark + ']... (CPU usage set to %s%) for block#%s', nbZeros, (this.conf.cpu * 100).toFixed(0), block.number, block.issuer.slice(0,6)); this.logger.info('Generating proof-of-work with %s leading zeros followed by [0-' + highMark + ']... (CPU usage set to %s%) for block#%s', nbZeros, (this.conf.cpu * 100).toFixed(0), block.number, block.issuer.slice(0,6));
const start = Date.now(); const start = Date.now();
let result = await powFarm.askNewProof({ let result = await powFarm.askNewProof({
newPoW: { conf: this.conf, block: block, zeros: nbZeros, highMark: highMark, forcedTime: forcedTime, pair: this.pair } newPoW: { conf: {
cpu: this.conf.cpu,
prefix: this.conf.prefix,
avgGenTime: this.conf.avgGenTime,
medianTimeBlocks: this.conf.medianTimeBlocks
}, block: block, zeros: nbZeros, highMark: highMark, forcedTime: forcedTime, pair: this.pair }
}); });
if (!result) { if (!result) {
this.logger.info('GIVEN proof-of-work for block#%s with %s leading zeros followed by [0-' + highMark + ']! stop PoW for %s', block.number, nbZeros, this.pair && this.pair.pub.slice(0,6)); this.logger.info('GIVEN proof-of-work for block#%s with %s leading zeros followed by [0-' + highMark + ']! stop PoW for %s', block.number, nbZeros, this.pair && this.pair.pub.slice(0,6));
......
...@@ -36,7 +36,7 @@ export class PowEngine { ...@@ -36,7 +36,7 @@ export class PowEngine {
} }
if (os.arch().match(/arm/)) { if (os.arch().match(/arm/)) {
stuff.conf.cpu /= 2; // Don't know exactly why is ARM so much saturated by PoW, so let's divide by 2 stuff.newPoW.conf.cpu /= 2; // Don't know exactly why is ARM so much saturated by PoW, so let's divide by 2
} }
return await this.cluster.proveByWorkers(stuff) return await this.cluster.proveByWorkers(stuff)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment