mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-23 20:36:44 +00:00
add logging when event wallet id is not present
This commit is contained in:
parent
34d1571669
commit
34b4c39ccd
1 changed files with 8 additions and 2 deletions
|
@ -1,12 +1,16 @@
|
|||
package com.sparrowwallet.sparrow.event;
|
||||
|
||||
import com.sparrowwallet.sparrow.io.Config;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class StorageEvent extends TimedEvent {
|
||||
private static final Logger log = LoggerFactory.getLogger(StorageEvent.class);
|
||||
|
||||
private static boolean firstRunDone = false;
|
||||
private static final Map<String, Long> eventTime = new HashMap<>();
|
||||
|
||||
|
@ -22,8 +26,10 @@ public class StorageEvent extends TimedEvent {
|
|||
eventTime.put(walletId, System.currentTimeMillis());
|
||||
timeMills = keyDerivationPeriod;
|
||||
} else if(action == Action.END) {
|
||||
long start = eventTime.get(walletId);
|
||||
if(firstRunDone) {
|
||||
Long start = eventTime.get(walletId);
|
||||
if(start == null) {
|
||||
log.error("Could not find start event time for wallet id " + walletId);
|
||||
} else if(firstRunDone) {
|
||||
keyDerivationPeriod = (int)(System.currentTimeMillis() - start);
|
||||
Config.get().setKeyDerivationPeriod(keyDerivationPeriod);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue