<p>The path you pass to dumpwallet is the filename of the dump.</p>

<p>If you pass the name of your wallet database itself (or any existing file, actually), it will get overwritten.</p>

CC BY-SA 3.0
2014-01-03T10:41:11.580Z
2014-01-03T10:41:11.580Z
Pieter Wuille
<p>I have repeated this process a few times, always with the same error.</p>

<p>In one terminal,</p>

<p>./bitcoind -testnet</p>

<p>in another</p>

<p>./bitcoind -testnet getnewaddress</p>

<p>mgj4Y8AvckxborhQzqFAhppcGVGFExqJvB</p>

<p>./bitcoind -testnet dumpwallet /path/to/testnet3/wallet.dat</p>

<p>error: {"code":-1,"message":"CDB() : can't open database file wallet.dat, error 22"}</p>

<p>./bitcoind -testnet stop</p>

<p>Bitcoin server stopping</p>

<p>In the original terminal, </p>

<p>libc++abi.dylib: terminate called throwing an exception
Abort trap: 6</p>

<p>Then I type</p>

<p>./bitcoind -testnet </p>

<p>Error: wallet.dat corrupt, salvage failed</p>

<p>Anybody have an idea what is going on? I updated my bitcoin to the latest on github. I also searched for the error 22 but didn't find anything. I'm guessing CDB means corrupted database. I also looked in debug.log, but I didn't see anything weird. </p>

<p>I know it is the dumpwallet command that is breaking it, because when I omit it from this process, nothing breaks. </p>

<p>The same things happens on the mainnet, altho I have not tested it as much.</p>

<p>Am I using the dumpwallet command incorrectly?</p>

<wallet><bitcoind><testnet>
dumpwallet always corrupts my wallet
Woozer
# dumpwallet always corrupts my wallet

(Asked by: username_0 on 2014-01-03)

I have repeated this process a few times, always with the same error.

In one terminal,

./bitcoind -testnet

in another

./bitcoind -testnet getnewaddress

mgj4Y8AvckxborhQzqFAhppcGVGFExqJvB

./bitcoind -testnet dumpwallet /path/to/testnet3/wallet.dat

error: {"code":-1,"message":"CDB() : can't open database file wallet.dat, error 22"}

./bitcoind -testnet stop

Bitcoin server stopping

In the original terminal,

libc++abi.dylib: terminate called throwing an exception
Abort trap: 6

Then I type

./bitcoind -testnet

Error: wallet.dat corrupt, salvage failed

Anybody have an idea what is going on? I updated my bitcoin to the latest on github. I also searched for the error 22 but didn't find anything. I'm guessing CDB means corrupted database. I also looked in debug.log, but I didn't see anything weird.

I know it is the dumpwallet command that is breaking it, because when I omit it from this process, nothing breaks.

The same things happens on the mainnet, altho I have not tested it as much.

Am I using the dumpwallet command incorrectly?

**Tags:** wallet, bitcoind, testnet


---

## 1 answers

### Answer by username_1 on 2014-01-03. Score: 6 | Accepted answer

The path you pass to dumpwallet is the filename of the dump.

If you pass the name of your wallet database itself (or any existing file, actually), it will get overwritten.


---

