More trace-level debugging in Synchronizer to help diagnose chain reorg issues

This commit is contained in:
catbref 2020-11-02 10:46:51 +00:00
parent 88da8d949f
commit ee08410260

View File

@ -406,6 +406,8 @@ public class Synchronizer {
Block block = new Block(repository, orphanBlockData);
block.orphan();
LOGGER.trace(String.format("Orphaned block height %d, sig %.8s", ourHeight, Base58.encode(orphanBlockData.getSignature())));
repository.saveChanges();
--ourHeight;
@ -433,6 +435,8 @@ public class Synchronizer {
newBlock.process();
LOGGER.trace(String.format("Processed block height %d, sig %.8s", newBlock.getBlockData().getHeight(), Base58.encode(newBlock.getBlockData().getSignature())));
repository.saveChanges();
Controller.getInstance().onNewBlock(newBlock.getBlockData());
@ -515,6 +519,8 @@ public class Synchronizer {
newBlock.process();
LOGGER.trace(String.format("Processed block height %d, sig %.8s", newBlock.getBlockData().getHeight(), Base58.encode(newBlock.getBlockData().getSignature())));
repository.saveChanges();
Controller.getInstance().onNewBlock(newBlock.getBlockData());