Exclude all conflicting transactions from audit score

This commit is contained in:
Mononaut
2023-07-25 14:00:17 +09:00
parent 81d1c0a4d5
commit d7b874ac49
7 changed files with 36 additions and 17 deletions

View File

@@ -100,6 +100,24 @@ class RbfCache {
this.dirtyTrees.add(treeId);
}
public has(txId: string): boolean {
return this.txs.has(txId);
}
public anyInSameTree(txId: string, predicate: (tx: RbfTransaction) => boolean): boolean {
const tree = this.getRbfTree(txId);
if (!tree) {
return false;
}
const txs = this.getTransactionsInTree(tree);
for (const tx of txs) {
if (predicate(tx)) {
return true;
}
}
return false;
}
public getReplacedBy(txId: string): string | undefined {
return this.replacedBy.get(txId);
}