Dumpwallet should not purge file

+2 votes
Hi.

Maybe it is a good idea, that dumpwallet does not overwrite / purge an existing file.

I did not read the info of dumpwallet correctly and did a: "dumpwallet wallet.dat".

I assumed I had to provide the walletfile I want to dump.

I know, this was fully my mistake and it is no problem since I still test in non-productive mode...

But the wallet.dat was immediately purged, the node crashed and of course the wallet was lost.

Would be much better when dumpwallet gives back a: "File already exists!"
asked Feb 5, 2017 by Alex

2 Answers

+1 vote
OK, feedback noted, probably we should at least disable overwriting the wallet file itself!
answered Feb 6, 2017 by MultiChain
0 votes
Alpha 29, just released, should fix this problem.
answered Mar 20, 2017 by MultiChain
Hi.

Would be also a good idea if dumpwallet does only work if the target file does not yet exist. Otherwise dumpwallet can overwrite everything that is accessible with the user that runs the multichain daemon.

This could be some kind of risk. A rpc user could overwrite important files like peers.dat, params.dat, some block files and you won't be able to easily recover since you do not know any active peers and your chain is corrupted.

Whitelisting also does not help here since we need to be able to exectue dumpwallet internally.
...