Multibit-Legacy / multibit

Deprecated Bitcoin Wallet
https://multibit.org
MIT License
456 stars 393 forks source link

Wallet saving on Win 8 throwing an exception #723

Closed jim618 closed 8 years ago

jim618 commented 8 years ago

Whilst testing on Win 8 I saw the following exception: 14:25:07.966 [Timer-3] DEBUG o.m.v.swing.HealthCheckTimerTask - Start of HealthCheckTimerTask 14:25:07.966 [Timer-3] DEBUG o.m.v.swing.HealthCheckTimerTask - Checking if wallets are dirty . . . 14:25:07.966 [Timer-3] DEBUG o.m.v.swing.HealthCheckTimerTask - Saving dirty wallet 'C:\Users\jim\Documents\petty-cash.wallet'... 14:25:07.966 [Timer-3] DEBUG org.multibit.file.FileHandler - Start of secureDelete 14:25:08.184 [Timer-3] DEBUG org.multibit.file.FileHandler - Result of delete of file 'C:\Users\jim\Documents\petty-cash.wallet' was true 14:25:08.184 [Timer-3] DEBUG org.multibit.file.FileHandler - End of secureDelete 14:25:08.184 [Timer-3] DEBUG org.multibit.file.FileHandler - Saving wallet file 'C:\Users\jim\Documents\petty-cash.wallet' ... 14:25:08.184 [Timer-3] ERROR o.m.v.swing.HealthCheckTimerTask - The new wallet "C:\Users\jim\Documents\petty-cash.wallet" could not be created. The error was "Cannot save wallet 'C:\Users\jim\Documents\petty-cash.wallet". 14:25:08.184 [AWT-EventQueue-0] DEBUG o.m.viewsystem.swing.StatusBar - StatusBar label = 'The new wallet "C:\Users\jim\Documents\petty-cash.wallet" could not be created. The error was "Cannot save wallet 'C:\Users\jim\Documents\petty-cash.wallet".' 14:25:08.184 [Timer-3] DEBUG o.m.v.swing.HealthCheckTimerTask - End of HealthCheckTimerTask

Also on start up MB Classic would load a rolling backup sometimes too. Looks like the change to saving the file stats might have broken something (synchronised ?)

I didn't see any bitcoin being lost as the rolling backups worked but clearly it needs looking at

jim618 commented 8 years ago

Made various changes to tighten up the wallet saving, mainly using a rename rather than a 'copy and secure delete' which was the proximal problem.

Tested on Mac and Win 8 ok.

Awaiting review and closing.

jim618 commented 8 years ago

You can test these changes directly from an installer if you want. I have created new installers and put them in: https://multibit.org/releases/multibit-classic/multibit-classic-0.0.0/

gary-rowe commented 8 years ago

Code review looks fine no errors seen from wallet. Logs do contain a lot of extra info from Bitcoinj though.

Closing.