Skip to content

Commit

Permalink
Check status of block propagation manager before starting or stopping (
Browse files Browse the repository at this point in the history
…#4122)

* check status of block propagation manager before starting or stopping

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
  • Loading branch information
daniellehrner authored Jul 18, 2022
1 parent e48b73b commit ac3e075
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
- Fixed a trie log layer issue on bonsai during reorg [#4069](https://github.com/hyperledger/besu/pull/4069)
- Fix transition protocol schedule to return the pre Merge schedule when reorg pre TTD [#4078](https://github.com/hyperledger/besu/pull/4078)
- Remove hash to sync from the queue only if the sync step succeeds [#4105](https://github.com/hyperledger/besu/pull/4105)
- The build process runs successfully even though the system language is not English [#4102](https://github.com/hyperledger/besu/pull/4102)
- The build process runs successfully even though the system language is not English [#4102](https://github.com/hyperledger/besu/pull/4102)
- Avoid starting or stopping the BlockPropagationManager more than once [#4122](https://github.com/hyperledger/besu/pull/4122)

## 22.7.0-RC1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,12 @@ private TrailingPeerRequirements calculateTrailingPeerRequirements() {
public CompletableFuture<Void> start() {
if (running.compareAndSet(false, true)) {
LOG.info("Starting synchronizer.");
blockPropagationManager.ifPresent(BlockPropagationManager::start);
blockPropagationManager.ifPresent(
manager -> {
if (!manager.isRunning()) {
manager.start();
}
});
CompletableFuture<Void> future;
if (fastSyncDownloader.isPresent()) {
future = fastSyncDownloader.get().start().thenCompose(this::handleSyncResult);
Expand All @@ -201,7 +206,12 @@ public void stop() {
fastSyncDownloader.ifPresent(FastSyncDownloader::stop);
fullSyncDownloader.ifPresent(FullSyncDownloader::stop);
maybePruner.ifPresent(Pruner::stop);
blockPropagationManager.ifPresent(BlockPropagationManager::stop);
blockPropagationManager.ifPresent(
manager -> {
if (manager.isRunning()) {
manager.stop();
}
});
}
}

Expand Down

0 comments on commit ac3e075

Please sign in to comment.