Re: auto backing up of wallet.dat

Participants: nelisky

Quote from: satoshi on August 26, 2010, 12:57:40 AM

I started posting in the other topic but I’ll repeat here, this thread seems more specific to the topic.

The main backup improvement will be a pre-generated pool of keys and a rescan at load to scrape missed transactions from the block history. Then a backup will last forward for a long time.

I was starting to post the same idea you said nelisky.

Yes, I saw your other post and I really like the poll of addresses, but we still need a way to easily back up when those get all used, don’t we? I know the address space is huge, but there might be applications that deliver thousands of addresses per day.

Quote from: satoshi on August 26, 2010, 12:57:40 AM

How about a json-rpc command that locks the wallet, flushes it, copies wallet.dat to a location you specified, then unlocks it? That would be a smaller project than the pooled keys, so maybe it could be done first.

What’s the simplest portable way to copy a file? Is there something in Boost?

What should it be named? maybe: backupwallet

Great on all accounts, name and implementation approach.

As for the file copy, why add to the boost dependency? I for one would love to get a core lib with very little deps. In C++ you can just use standard file streams, can’t you? Something like http://www.dreamincode.net/code/snippet2306.htm (out of a quick google, didn’t try but looks correct).

To put the cherry on top, why not add a trigger that makes the copy whenever there’s a change to the wallet? Well, this would depend on file locking to work properly and that sucks on windows iirc. Been a while since I had to code there Smiley