Ava Chow fb52023ee6
Merge bitcoin/bitcoin#30684: init: fix init fatal error on invalid negated option value
ee47ca29d6ef55650a0af63bca817c5d494f31ef init: fix fatal error on '-wallet' negated option value (furszy)

Pull request description:

  Currently, if users provide a double negated value such as '-nowallet=0' or a non-boolean
  convertible value to a negated option such as '-nowallet=not_a_boolean', the initialization
  process results in a fatal error, causing an unclean shutdown and displaying a poorly
  descriptive error message:
  "JSON value of type bool is not of expected type string." (On bitcoind. The GUI
  does not display any error msg - upcoming PR -).

  This PR fixes the issue by ensuring that only string values are returned in the
  the "wallet" settings list, failing otherwise. It also improves the clarity of the
  returned error message.

  Note:
  This bug was introduced in https://github.com/bitcoin/bitcoin/pull/22217. Where the `GetArgs("-wallet")` call was
  replaced by `GetSettingsList("-wallet")`.

ACKs for top commit:
  achow101:
    ACK ee47ca29d6ef55650a0af63bca817c5d494f31ef
  ryanofsky:
    Code review ACK ee47ca29d6ef55650a0af63bca817c5d494f31ef, just adding the suggested test since last review
  TheCharlatan:
    ACK ee47ca29d6ef55650a0af63bca817c5d494f31ef
  ismaelsadeeq:
    Tested ACK ee47ca29d6ef55650a0af63bca817c5d494f31ef

Tree-SHA512: 5f01076f74a048019bb70791160f0accc2db7a457d969cb23687bed81ccbbdec1dda68311e7c6e2dd56250e23e8d926d4066e5014b2a99a2fc202e24ed264fbd
2024-09-09 12:44:29 -04:00
..
2024-08-29 13:49:57 +02:00
2024-08-28 19:09:51 +02:00
2024-07-08 11:12:01 +02:00
2024-07-08 11:12:01 +02:00
2024-08-29 13:49:57 +02:00