Skip to content

Encrypted wallets and -salvagewallet #2480

@laanwj

Description

@laanwj

Salvaging an encrypted wallet makes bitcoin quit with the following error:

bitcoin-qt: /usr/include/boost/thread/pthread/pthread_mutex_scoped_lock.hpp:26: boost::pthread::pthread_mutex_scoped_lock::pthread_mutex_scoped_lock(pthread_mutex_t*): Assertion `!pthread_mutex_lock(m)' failed.
Aborted (core dumped)

Steps to reproduce:

  1. Create new testnet wallet
  2. Encrypt with a passphrase
  3. Run with -salvagewallet

debug.log:

init message: Verifying wallet...
dbenv.open LogDir=/home/.../.bitcoin/testnet3/database ErrorFile=/home/.../.bitcoin/testnet3/db.log
Renamed wallet.dat to wallet.1365321353.bak
Salvage(aggressive) found 317 records
Bound to [::]:18333
Bound to 0.0.0.0:18333
init message: Loading block index...
Opening LevelDB in /home/.../.bitcoin/testnet3/blocks/index
Opened LevelDB successfully
Opening LevelDB in /home/.../.bitcoin/testnet3/chainstate
Opened LevelDB successfully
LoadBlockIndexDB(): last block file = 0
LoadBlockIndexDB(): last block file info: CBlockFileInfo(blocks=65142, size=47761205, heights=0...65141, time=2011-02-02...2013-04-07)
LoadBlockIndexDB(): transaction index disabled
LoadBlockIndexDB(): hashBestChain=000000000a00a2818dd027f323048e7e0b273a3cd0511b0ad129166d9d5d45a2  height=65141 date=2013-04-07 07:46:02
init message: Verifying blocks...
Verifying last 288 blocks at level 3
No coin database inconsistencies in last 289 blocks (3282 transactions)
 block index            1377ms
init message: Loading wallet...
nFileVersion = 80000
Performing wallet upgrade to 60000
Cannot initialize keypool

The keypool error appears every time at startup, from then on. The wallet may be corrupted, but it from the error appears to be a bug in the code with mutexes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions