possible inconsistency in JSONRPCError #20209

issue PiRK opened this issue on October 21, 2020
  1. PiRK commented at 5:48 AM on October 21, 2020: contributor

    #16250 added a JSONRPCError(RPC_INVALID_PARAMETER, "Missing redeemScript/witnessScript") error in src/rpc/rawtransaction_util.cpp in case both the redeemScript and witnessScript are missing. Just before that, a RPCTypeCheckObj() is called with fAllowNull=True. If fAllowNull had been false, this function would have thrown a JSONRPCError(RPC_TYPE_ERROR, "Missing redeemScript")

    I'm not sure which error is the right one for this case, between RPC_INVALID_PARAMETER and RPC_TYPE_ERROR, but I feel like it should be the same in both case.

  2. PiRK added the label Bug on Oct 21, 2020
  3. PiRK renamed this:
    inconsistency in JSONRPCError
    possible inconsistency in JSONRPCError
    on Oct 21, 2020
  4. fanquake added the label RPC/REST/ZMQ on Oct 21, 2020
  5. meshcollider commented at 4:22 AM on September 28, 2021: contributor

    From what I can tell, this isn't actually an issue, it is more a complaint about the code?

    RPCTypeCheckObj() has fAllowNull=True set as a constant in the code, so the other JSONRPCError can never occur.

    Closing this, but let me know if there is a real issue here.

  6. meshcollider closed this on Sep 28, 2021

  7. DrahtBot locked this on Oct 30, 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