Skip to content

Commit

Permalink
Merge pull request #5030 from chimp1984/fix-incorrect-map-lookup-forh…
Browse files Browse the repository at this point in the history
…istorical-data-stores

[1.5.4] We need to use the getMapOfAllData method for HistoricalDataStoreServices
  • Loading branch information
sqrrm authored Dec 31, 2020
2 parents 0c1bc02 + 85caf88 commit 4c14d4e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ public void readFromResourcesSync(String postFix) {

public Map<P2PDataStorage.ByteArray, PersistableNetworkPayload> getMap() {
return services.stream()
.flatMap(service -> service.getMap().entrySet().stream())
.flatMap(service -> {
Map<P2PDataStorage.ByteArray, PersistableNetworkPayload> map = service instanceof HistoricalDataStoreService ?
((HistoricalDataStoreService) service).getMapOfAllData() :
service.getMap();
return map.entrySet().stream();
})
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
}

Expand Down

0 comments on commit 4c14d4e

Please sign in to comment.