move block audit endpoint from mining to bitcoin routes

This commit is contained in:
Mononaut
2022-11-25 19:32:50 +09:00
parent 1f78061c08
commit 482805b132
5 changed files with 30 additions and 14 deletions

View File

@@ -651,6 +651,19 @@ class Blocks {
return returnBlocks;
}
public async $getBlockAuditSummary(hash: string): Promise<any> {
let summary = await BlocksAuditsRepository.$getBlockAudit(hash);
// fallback to non-audited transaction summary
if (!summary?.transactions?.length) {
const strippedTransactions = await this.$getStrippedBlockTransactions(hash);
summary = {
transactions: strippedTransactions
};
}
return summary;
}
public getLastDifficultyAdjustmentTime(): number {
return this.lastDifficultyAdjustmentTime;
}