compute latest block on open

This commit is contained in:
Craig Raw 2024-04-03 12:40:51 +02:00
parent 9ba4458f48
commit e5e94c3ea6

View file

@ -15,10 +15,10 @@ public class SparrowChainSupplier implements ChainSupplier {
public SparrowChainSupplier(Integer storedBlockHeight) { public SparrowChainSupplier(Integer storedBlockHeight) {
this.storedBlockHeight = AppServices.getCurrentBlockHeight() == null ? (storedBlockHeight != null ? storedBlockHeight : 0) : AppServices.getCurrentBlockHeight(); this.storedBlockHeight = AppServices.getCurrentBlockHeight() == null ? (storedBlockHeight != null ? storedBlockHeight : 0) : AppServices.getCurrentBlockHeight();
this.latestBlock = computeLatestBlock();
} }
public void open() { public void open() {
this.latestBlock = computeLatestBlock();
EventManager.get().register(this); EventManager.get().register(this);
} }