fix coinbase audit

This commit is contained in:
Léo Haf 2025-03-17 14:43:54 +01:00
parent 00811a438d
commit 125b65e586
Signed by: Retropex
GPG Key ID: 0E37EBAB8574F005

View File

@ -29,6 +29,7 @@ class Audit {
let matchedWeight = 0; let matchedWeight = 0;
let projectedWeight = 0; let projectedWeight = 0;
let countCb = 0;
let spamWeight = 0; let spamWeight = 0;
let blkWeight = 0; let blkWeight = 0;
@ -82,11 +83,14 @@ class Audit {
} }
for (const tx of transactions){ for (const tx of transactions){
if(tx.spam !== undefined){ if (countCb !== 0){
if (tx.spam == true){ if(tx.spam !== undefined){
spamWeight += tx.weight; if (tx.spam == true){
spamWeight += tx.weight;
}
} }
} }
countCb += 1;
} }
// we can expect an honest miner to include 'displaced' transactions in place of recent arrivals and censored txs // we can expect an honest miner to include 'displaced' transactions in place of recent arrivals and censored txs