Merge pull request #3881 from mempool/mononaut/separate-audit-api

Separate summary and audit-summary API endpoints
This commit is contained in:
softsimon
2023-07-01 19:43:20 +02:00
committed by GitHub
7 changed files with 129 additions and 161 deletions

View File

@@ -1007,19 +1007,11 @@ class Blocks {
}
public async $getBlockAuditSummary(hash: string): Promise<any> {
let summary;
if (['mainnet', 'testnet', 'signet'].includes(config.MEMPOOL.NETWORK)) {
summary = await BlocksAuditsRepository.$getBlockAudit(hash);
return BlocksAuditsRepository.$getBlockAudit(hash);
} else {
return null;
}
// fallback to non-audited transaction summary
if (!summary?.transactions?.length) {
const strippedTransactions = await this.$getStrippedBlockTransactions(hash);
summary = {
transactions: strippedTransactions
};
}
return summary;
}
public getLastDifficultyAdjustmentTime(): number {