Skip to content

Commit

Permalink
Decrease autosave delay to 5 seconds.
Browse files Browse the repository at this point in the history
The height inconsistency between the wallet and the blockstore after a crash got too large in some cases.
  • Loading branch information
Andreas Schildbach committed Aug 30, 2016
1 parent e45d8d5 commit 0a4b5a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions wallet/src/de/schildbach/wallet/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public final static class Files
/** Filename of the wallet. */
public static final String WALLET_FILENAME_PROTOBUF = "wallet-protobuf" + FILENAME_NETWORK_SUFFIX;

/** How often the wallet is autosaved. */
public static final long WALLET_AUTOSAVE_DELAY_MS = 5 * DateUtils.SECOND_IN_MILLIS;

/** Filename of the automatic key backup (old format, can only be read). */
public static final String WALLET_KEY_BACKUP_BASE58 = "key-backup-base58" + FILENAME_NETWORK_SUFFIX;

Expand Down
2 changes: 1 addition & 1 deletion wallet/src/de/schildbach/wallet/WalletApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void uncaughtException(final Thread thread, final Throwable throwable)

private void afterLoadWallet()
{
wallet.autosaveToFile(walletFile, 10, TimeUnit.SECONDS, new WalletAutosaveEventListener());
wallet.autosaveToFile(walletFile, Constants.Files.WALLET_AUTOSAVE_DELAY_MS, TimeUnit.MILLISECONDS, new WalletAutosaveEventListener());

// clean up spam
wallet.cleanup();
Expand Down

0 comments on commit 0a4b5a9

Please sign in to comment.