Skip to content

Backupwallet RPC call destroyed wallet if target equals the source wallet file #11375

@tomasvdw

Description

@tomasvdw

When the target for backupwallet is the source wallet file or directory, the wallet file is cleared to zero length

Reproduce

bitcoin-cli backupwallet ~/.bitcoin/

Expected behaviour

Command should fail

Actual behaviour

Wallet is destroyed.

Reported here
https://www.reddit.com/r/btc/comments/719kz3/just_lost_4bch_backing_up_my_walletdat_file/

Fix proposed in #11376

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions