Assertion failed! rpcwallet.cpp Line 3838 #18944

issue mrbabtc opened this issue on May 11, 2020
  1. mrbabtc commented at 12:31 PM on May 11, 2020: none

    Im on W10 x64 using the GUI. I'm syncing, the wallet is key disabled and it has 30k address watch only, all these are segwit p2sh. When I execute the rpc command getaddressesbylabel "" I get the following error message image

    If I click Anular , bitcoin core crash If I click Omitir I get the rpc response: { "": { "purpose": "unknown" }, "": { "purpose": "unknown" } }

  2. mrbabtc added the label Bug on May 11, 2020
  3. jonasschnelli commented at 12:41 PM on May 11, 2020: contributor

    It looks like you have duplicated addresses in your wallet.

    // CWallet::mapAddressBook is not expected to contain duplicate
    // address strings, but build a separate set as a precaution just in
    // case it does.
    bool unique = addresses.emplace(address).second;
    

    How did you import the addresses/scripts?

  4. mrbabtc commented at 1:58 PM on May 11, 2020: none

    It looks like you have duplicated addresses in your wallet.

    // CWallet::mapAddressBook is not expected to contain duplicate
    // address strings, but build a separate set as a precaution just in
    // case it does.
    bool unique = addresses.emplace(address).second;
    

    How did you import the addresses/scripts?

    I imported it with importMulti , but maybe ran it multiple times, how I could check it? Anyways, if you import again the same address or privkey, bitcoin core shouldn't add it again if it is already in the wallet

  5. ryanofsky commented at 2:51 PM on May 11, 2020: contributor

    Looking at the code #18944 (comment), it seems like this should only happen if there are two CTxDestination objects that don't compare equal but do have the same EncodeDestination string representation. Am I misreading or is the something known to happen?

  6. mrbabtc commented at 3:51 PM on May 11, 2020: none

    I created a new wallet with these 30k address and I can correctly run the rpc command, but IDK why could be repeated address or keys in a wallet file created with same bitcoin core

  7. maflcko commented at 5:45 PM on May 11, 2020: member

    @ryanofsky This happens at least in the case of two malformed WitnessUnknown and/or a CTxNoDestination, right?

  8. maflcko commented at 5:45 PM on May 11, 2020: member

    All of them map to an empty string

  9. maflcko commented at 12:41 PM on May 14, 2020: member

    Though, it should be impossible to import malformed WitnessUnknown, see #18974

  10. maflcko added the label Wallet on May 14, 2020
  11. maflcko commented at 3:01 PM on May 14, 2020: member

    Could this be caused by a corrupted bdb file?

  12. pinheadmz commented at 3:23 PM on March 7, 2023: member

    I think this issue can be closed. In addition to #18974 the assertion has been replaced with a much safer check:

    https://github.com/bitcoin/bitcoin/blob/d4ebdceaef130e4b68e5d5db67eecfefd24b4239/src/wallet/rpc/addresses.cpp#L668-L674

  13. maflcko added the label RPC/REST/ZMQ on Mar 7, 2023
  14. maflcko commented at 3:40 PM on March 7, 2023: member

    yeah, CHECK_NONFATAL doesn't crash the program, but it also aborts the current RPC

  15. maflcko commented at 3:40 PM on March 7, 2023: member

    It would be good to know if this is still an issue with a recent version of Bitcoin Core?

  16. pinheadmz commented at 1:54 PM on April 27, 2023: member

    This is no longer an issue in recent versions of Bitcoin Core. We'll close it for now, please feel free to add additional comments or open a new issue if you think that would be helpful.

  17. pinheadmz closed this on Apr 27, 2023

  18. bitcoin locked this on Apr 26, 2024

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: 2026-04-13 15:14 UTC

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