wallet: Avoid exception when loading with unsupported external signer #22168

pull promag wants to merge 1 commits into bitcoin:master from promag:2021-06-wallet-extsig changing 1 files +8 −0
  1. promag commented at 11:37 am on June 6, 2021: member

    To reproduce the exception:

    • build with --enable-external-signer
    • create a wallet, lets say ledger_nano_s
    • now build with --disable-external-signer
    • running daemon with -wallet=ledger_nano_s fails
    • running daemon with -nowallet and calling cli loadwallet ledger_nano_s fails
    • repeating loadwallet after the above gives “wallet already loaded”

    The exception is std::out_of_range from std::map::at raised by auto spk_man = m_spk_managers.at(id).get().

    Fix this by early checking for ENABLE_EXTERNAL_SIGNER.

  2. wallet: Avoid exception when loading with unsupported external signer 51407242d2
  3. promag commented at 11:38 am on June 6, 2021: member
    @achow101 not sure its the best place to check for this, please advice.
  4. fanquake added the label Wallet on Jun 6, 2021
  5. achow101 commented at 5:27 pm on June 6, 2021: member
    This is definitely not the way. The correct way would be to check the flags at the beginning of loading and error out of the external signer is not supported. I’ll make a PR.
  6. promag closed this on Jun 6, 2021

  7. promag deleted the branch on Jun 6, 2021
  8. sidhujag referenced this in commit 15f3ffa838 on Jun 9, 2021
  9. DrahtBot locked this on Aug 18, 2022


promag achow101

Labels
Wallet


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-04 18:12 UTC

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