fix: truncate pow compute time before submitting

This commit is contained in:
Aravinth Manivannan
2023-07-02 20:00:25 +05:30
parent 3e5936cb83
commit 1b05cdc391
3 changed files with 2 additions and 9 deletions

View File

@@ -55,7 +55,7 @@ export const solveCaptchaRunner = async (e: Event): Promise<void> => {
worker.onmessage = async (event: MessageEvent) => {
const resp: ServiceWorkerWork = event.data;
console.log(
`Proof generated. Difficuly: ${config.difficulty_factor} Duration: ${resp.duration}`
`Proof generated. Difficuly: ${config.difficulty_factor} Duration: ${resp.work.time}`
);
const proof: Work = {
@@ -63,7 +63,7 @@ export const solveCaptchaRunner = async (e: Event): Promise<void> => {
string: config.string,
nonce: resp.work.nonce,
result: resp.work.result,
time: resp.work.time,
time: Math.trunc(resp.work.time),
worker_type: resp.work.worker_type,
};