Omit possible high-sigop txs from block health score

This commit is contained in:
Mononaut
2023-05-17 11:46:50 -04:00
parent 12639ade6c
commit bdb44c4609
10 changed files with 38 additions and 12 deletions

View File

@@ -335,6 +335,7 @@ export class BlockComponent implements OnInit, OnDestroy {
const isMissing = {};
const isSelected = {};
const isFresh = {};
const isSigop = {};
this.numMissing = 0;
this.numUnexpected = 0;
@@ -354,6 +355,9 @@ export class BlockComponent implements OnInit, OnDestroy {
for (const txid of blockAudit.freshTxs || []) {
isFresh[txid] = true;
}
for (const txid of blockAudit.sigopTxs || []) {
isSigop[txid] = true;
}
// set transaction statuses
for (const tx of blockAudit.template) {
tx.context = 'projected';
@@ -362,7 +366,7 @@ export class BlockComponent implements OnInit, OnDestroy {
} else if (inBlock[tx.txid]) {
tx.status = 'found';
} else {
tx.status = isFresh[tx.txid] ? 'fresh' : 'missing';
tx.status = isFresh[tx.txid] ? 'fresh' : (isSigop[tx.txid] ? 'sigop' : 'missing');
isMissing[tx.txid] = true;
this.numMissing++;
}