use of co.rsk.peg.whitelist.LockWhitelist in project rskj by rsksmart.
the class BridgeStorageProvider method getLockWhitelist.
public LockWhitelist getLockWhitelist() {
if (lockWhitelist != null) {
return lockWhitelist;
}
Pair<HashMap<Address, OneOffWhiteListEntry>, Integer> oneOffWhitelistAndDisableBlockHeightData = safeGetFromRepository(LOCK_ONE_OFF_WHITELIST_KEY, data -> BridgeSerializationUtils.deserializeOneOffLockWhitelistAndDisableBlockHeight(data, networkParameters));
if (oneOffWhitelistAndDisableBlockHeightData == null) {
lockWhitelist = new LockWhitelist(new HashMap<>());
return lockWhitelist;
}
Map<Address, LockWhitelistEntry> whitelistedAddresses = new HashMap<>();
whitelistedAddresses.putAll(oneOffWhitelistAndDisableBlockHeightData.getLeft());
if (activations.isActive(RSKIP87)) {
whitelistedAddresses.putAll(safeGetFromRepository(LOCK_UNLIMITED_WHITELIST_KEY, data -> BridgeSerializationUtils.deserializeUnlimitedLockWhitelistEntries(data, networkParameters)));
}
lockWhitelist = new LockWhitelist(whitelistedAddresses, oneOffWhitelistAndDisableBlockHeightData.getRight());
return lockWhitelist;
}
Aggregations