Multibit-Legacy / multibit-hd

Deprecated Bitcoin Wallet
https://multibit.org/blog/2017/07/26/multibit-shutdown.html
Other
169 stars 124 forks source link

Rolling backup code needs more resilience #857

Open jim618 opened 8 years ago

jim618 commented 8 years ago

The rolling backup code isn't resilient to users renaming/ copying rolling back files (why they would do that who knows)

MultiBit HD version: 0.2.0
Operating system: 64 6.3 Windows 8.1

No user notes

Number of stack traces: 1
First stack trace:
java.lang.IllegalArgumentException: Rolling backup files are in the wrong format. Error = 'Invalid format: "bit-2014012018"'
    at org.multibit.hd.core.managers.BackupManager.getRollingBackups(BackupManager.java:226) [multibit-hd.jar:na]
    at org.multibit.hd.core.managers.BackupManager.createRollingBackup(BackupManager.java:292) [multibit-hd.jar:na]
    at org.multibit.hd.core.services.BackupService.performRollingBackup(BackupService.java:250) [multibit-hd.jar:na]
    at org.multibit.hd.core.services.BackupService.access$300(BackupService.java:58) [multibit-hd.jar:na]
    at org.multibit.hd.core.services.BackupService$1.run(BackupService.java:163) [multibit-hd.jar:na]   
gary-rowe commented 8 years ago

Hmmm, users aren't supposed to be renaming those internal files. This is akin to trying to locate a renamed mbhd.yaml file. Not sure we should be trying to second guess their actions here.

Moving to Discussion milestone until we decide to push forward.

jim618 commented 8 years ago

Users shouldn't be changing those files no. I recommend we upgrade the filtering so that only files of the right format are used and the rest ignored. At the moment if there are 'other files' the IllegalArgumentException gets thrown all the way up the stack which seems a bit drastic.