wallet: copied wallet detection problem #14304

issue ken2812221 openend this issue on September 24, 2018
  1. ken2812221 commented at 1:00 am on September 24, 2018: contributor
    0src/bitcoind -daemon -regtest
    1src/bitcoin-cli -regtest stop
    2cp ~/.bitcoin/wallet/wallet.dat ~/.bitcoin/wallet/wallet2.dat
    3src/bitcoind -daemon -regtest
    4src/bitcoin-cli -regtest loadwallet wallet2.dat # The first time it would fail to load wallet
    5src/bitcoin-cli -regtest loadwallet wallet2.dat # The second time it would succeed to load wallet, but this would cause error because of duplicate fileid
    

    It would flush wallet.dat and close Db* in mapDb['wallet.dat'].second, so mapDb['wallet.dat'].second would be nullptr. Then there is no available Db* to detect if the wallet fileid is duplicated.

    I’m not sure if the issue is related to #14163, but I found this while debugging it.

    https://github.com/bitcoin/bitcoin/blob/920c090f63f4990bf0f3b3d1a6d3d8a8bcd14ba0/src/wallet/db.cpp#L32-L53

  2. fanquake added the label Wallet on Sep 24, 2018
  3. MarcoFalke added the label Bug on Sep 24, 2018
  4. MarcoFalke added this to the milestone 0.18.0 on Sep 24, 2018
  5. laanwj closed this on Oct 24, 2018

  6. laanwj referenced this in commit 2b88f67e0b on Oct 24, 2018
  7. xdustinface referenced this in commit 3738170471 on Apr 4, 2021
  8. xdustinface referenced this in commit dc09345e28 on Apr 4, 2021
  9. xdustinface referenced this in commit 85349ca1f7 on Apr 4, 2021
  10. xdustinface referenced this in commit 86357cc55f on Apr 5, 2021
  11. xdustinface referenced this in commit 3bee6d011c on Apr 13, 2021
  12. DrahtBot locked this on Sep 8, 2021
  13. gades referenced this in commit 6479be240b on Mar 22, 2022


ken2812221

Labels
Bug Wallet

Milestone
0.18.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 18:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me