mirror of
https://github.com/corda/corda.git
synced 2025-03-14 16:26:36 +00:00
Improving network map and CRL caches (#866)
* Improving network map and CRL caches * Addressing review comments
This commit is contained in:
parent
d651ad9bb3
commit
2b2b856a17
@ -75,7 +75,15 @@ class NetworkMapWebService(private val nodeInfoStorage: NodeInfoStorage,
|
||||
.softValues()
|
||||
.build(nodeInfoStorage::getNodeInfo)
|
||||
|
||||
private val networkMaps: NetworkMaps? get() = networkMapCache[true]
|
||||
private val networkMaps: NetworkMaps?
|
||||
get() {
|
||||
if (networkMapCache[true]?.publicNetworkMap == null) {
|
||||
// Refresh cache every time the public network map is NULL.
|
||||
networkMapCache.refresh(true)
|
||||
}
|
||||
return networkMapCache[true]
|
||||
}
|
||||
|
||||
private val currentNodeInfoHashes: Set<SecureHash> get() = networkMaps?.allNodeInfoHashes ?: emptySet()
|
||||
private val currentNetworkParameters: NetworkParameters? get() = networkMaps?.publicNetworkMap?.networkParameters?.networkParameters
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user