RPC/Wallet: unloadwallet: Clarify docs/error when both the RPC request and wallet_name parameter specify a wallet #20462

pull luke-jr wants to merge 1 commits into bitcoin:master from luke-jr:unloadwallet_namematch_pt1 changing 2 files +4 −3
  1. luke-jr commented at 2:07 PM on November 23, 2020: member

    Just documentation clarifications from #20448

  2. MarcoFalke commented at 2:13 PM on November 23, 2020: member

    cr ACK 81162ec41e5ee2ce06829dea8865925c1155cc68

  3. in src/wallet/rpcwallet.cpp:2795 in 81162ec41e outdated
    2791 | @@ -2792,7 +2792,7 @@ static RPCHelpMan unloadwallet()
    2792 |                  "Unloads the wallet referenced by the request endpoint otherwise unloads the wallet specified in the argument.\n"
    2793 |                  "Specifying the wallet name on a wallet endpoint is invalid.",
    2794 |                  {
    2795 | -                    {"wallet_name", RPCArg::Type::STR, /* default */ "the wallet name from the RPC request", "The name of the wallet to unload."},
    2796 | +                    {"wallet_name", RPCArg::Type::STR, /* default */ "the wallet name from the RPC request", "The name of the wallet to unload. Must be provided in the RPC request or this parameter (but not both)."},
    


    promag commented at 2:16 PM on November 23, 2020:

    RPC request or RPC endpoint?

  4. promag commented at 2:17 PM on November 23, 2020: member

    RPC description kind of says the same already:

    Unloads the wallet referenced by the request endpoint otherwise unloads the wallet specified in the argument.
    Specifying the wallet name on a wallet endpoint is invalid.
    

    ACK improving current error.

  5. in test/functional/wallet_multiwallet.py:358 in 81162ec41e outdated
     354 | @@ -355,7 +355,7 @@ def wallet_file(name):
     355 |          assert_raises_rpc_error(-1, "JSON value is not a string as expected", self.nodes[0].unloadwallet)
     356 |          assert_raises_rpc_error(-18, "Requested wallet does not exist or is not loaded", self.nodes[0].unloadwallet, "dummy")
     357 |          assert_raises_rpc_error(-18, "Requested wallet does not exist or is not loaded", node.get_wallet_rpc("dummy").unloadwallet)
     358 | -        assert_raises_rpc_error(-8, "Cannot unload the requested wallet", w1.unloadwallet, "w2"),
     359 | +        assert_raises_rpc_error(-8, "Both the RPC request wallet and wallet_name parameter were provided (only one allowed)", w1.unloadwallet, "w2"),
    


    jonatack commented at 2:46 PM on November 23, 2020:

    Please include a test with the same wallet name, e.g. w1.unloadwallet, w1.getwalletinfo()["walletname"]

  6. DrahtBot added the label RPC/REST/ZMQ on Nov 23, 2020
  7. DrahtBot added the label Wallet on Nov 23, 2020
  8. luke-jr force-pushed on Nov 23, 2020
  9. luke-jr commented at 3:42 PM on November 23, 2020: member

    Addressed review by @jonatack

  10. jonatack commented at 7:22 PM on November 23, 2020: member

    ACK e8303a08e7226cd9640001b9b9d50afd8533dc8e

  11. DrahtBot commented at 9:40 PM on November 23, 2020: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #20448 (RPC/Wallet: unloadwallet: Allow specifying wallet_name param matching RPC request, and document behaviour by luke-jr)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  12. RPC/Wallet: unloadwallet: Clarify docs/error when both the RPC endpoint and wallet_name parameter specify a wallet b1f59d55d9
  13. luke-jr force-pushed on Nov 24, 2020
  14. luke-jr commented at 5:32 AM on November 24, 2020: member

    ...also used "endpoint" in error message and commit message...

  15. MarcoFalke commented at 7:07 AM on November 24, 2020: member

    review ACK b1f59d55d920d2b35269b474762f94fec87bfb16

  16. jonatack commented at 10:43 AM on November 24, 2020: member

    re-ACK b1f59d55d920d2b35269b474762f94fec87bfb16 per git diff e8303a0 b1f59d5

  17. MarcoFalke added the label Needs backport (0.21) on Nov 24, 2020
  18. MarcoFalke removed the label Needs backport (0.21) on Nov 24, 2020
  19. MarcoFalke merged this on Nov 24, 2020
  20. MarcoFalke closed this on Nov 24, 2020

  21. MarcoFalke added the label Docs on Nov 24, 2020
  22. MarcoFalke commented at 11:09 AM on November 24, 2020: member

    Backported in #20475

  23. sidhujag referenced this in commit 94ee716b40 on Nov 24, 2020
  24. MarcoFalke referenced this in commit 3fae2f95f1 on Nov 24, 2020
  25. DrahtBot locked this on Feb 15, 2022

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