Skip to content
Snippets Groups Projects
Commit adf740c2 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

docs(1434): add more logs

parent eba75b7e
No related branches found
No related tags found
No related merge requests found
......@@ -545,6 +545,7 @@ export class DuniterBlockchain {
if (block) {
await this.undoDeleteTransactions(block, dal);
}
NewLogger().info("Reverted block #%s", blockstamp);
}
static async undoMembersUpdate(blockstamp: string, dal: FileDAL) {
......
......@@ -277,6 +277,11 @@ export class Switcher<T extends SwitchBlock> {
s[0].number + i,
e && e.message
);
if (e.type === "NotFoundError" && this.logger) {
this.logger.error(
"CRITICAL: LevelDB has inconsistent state: " + e.stack
);
}
added = false;
}
i++;
......
......@@ -165,7 +165,7 @@ export class BlockchainContext {
async revertCurrentBlock(): Promise<DBBlock> {
const head_1 = await this.dal.bindexDAL.head(1);
this.logger.debug("Reverting block #%s...", head_1.number);
this.logger.debug("Reverting block #%s-%s...", head_1.number, head_1.hash);
const block = await this.dal.getAbsoluteValidBlockInForkWindow(
head_1.number,
head_1.hash
......
......@@ -28,5 +28,9 @@ export async function dumpBlocks(
}
export function dumpBlockIfDefined(b: DBBlock | undefined | null) {
console.log("-------- BLOCK --------");
console.log("Number: " + b?.number);
console.log("Hash: " + b?.hash);
console.log("");
console.log(BlockDTO.fromJSONObject(b).getRawSigned());
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment