Error cannot specify both conf_target and fee_rate - when it is not actually specified #23588

issue StasToken opened this issue on November 25, 2021
  1. StasToken commented at 8:40 AM on November 25, 2021: none

    Version 22.0 Problem. When trying to send a transaction request to ./bitcoind with an explicit indication of the commission, an error occurs

    {
       "jsonrpc":"1.0",
       "id":"AP",
       "method":"sendtoaddress",
       "params":[
          "tb1ql7w62elx9ucw4pj5lgw4l028hmuw80sndtntxt",
          "0.00002",
          "comment",
          "",
          false,
          false,
          null,
          "unset",
          false,
          "0.00001488"
       ]
    }
    

    The following options were also tried:

    {
       "jsonrpc":"1.0",
       "id":"API",
       "method":"sendtoaddress",
       "params":[
          "tb1ql7w62elx9ucw4pj5lgw4l028hmuw80sndtntxt",
          "0.00002",
          "comment",
          "",
          false,
          false,
          -1,
          "unset",
          false,
          "0.00001488"
       ]
    }
    

    and

    {
       "jsonrpc":"1.0",
       "id":"API lottery",
       "method":"sendtoaddress",
       "params":[
          "tb1ql7w62elx9ucw4pj5lgw4l028hmuw80sndtntxt",
          "0.00002",
          "comment",
          "",
          false,
          false,
          0,
          "unset",
          false,
          "0.00001488"
       ]
    }
    

    Getting any of the above JSON bitcoin thinks that conf_target is full when in fact it is not. Which is why I can't specify fee_rate at the very end. if you remove conf_target from json altogether, then the order of the parser is violated and it parses the fields incorrectly. An error will be received in all three requests:

    Cannot specify both conf_target and fee_rate. Please provide either a confirmation target in blocks for automatic fee estimation, or an explicit fee rate.

    Expected behavior: Sending a transaction with a fixed commission (0.00001488) specified in the request

    Playback:

    $ ./bitcoind -testnet

    curl --user master --data-binary '{"jsonrpc":"1.0","id":"API","method":"sendtoaddress","params":["tb1ql7w62elx9ucw4pj5lgw4l028hmuw80sndtntxt","0.00002","comment","",false,false,0,"unset",false,"0.00001488"]}' -H 'content-type: text/plain;' http://127.0.0.1:18332/

    When asking this question, I was guided by the documentation on the official website, which by the way does not contain a description of some fields, does not have an example of curl and needs to be updated. So for example there are examples with the fee_rate field, but not where there is no description of it.

  2. StasToken added the label Bug on Nov 25, 2021
  3. MarcoFalke added the label RPC/REST/ZMQ on Nov 25, 2021
  4. MarcoFalke added the label Wallet on Nov 25, 2021
  5. StasToken commented at 10:57 PM on November 29, 2021: none

    Hey, will anyone respond to this problem? :)

  6. sipa commented at 11:08 PM on November 29, 2021: member

    You need to use null in JSON to specify unused arguments (or use named style, as use an object of "name":values for just the intended arguments instead of an array of arguments).

  7. MarcoFalke commented at 12:13 PM on November 30, 2021: member

    I think OP tried to set null (json) and it didn't work?

  8. StasToken commented at 5:32 PM on December 1, 2021: none

    Yes it seems to have worked at last. Thank you very much. You can answer one more small but related question about commissions. I want to set a fixed commission to know the exact expense before I send the transaction to the network. I set the commission 2000 the commission amount is multiplied by the number of 141 bytes and the commission will be 0.00282000 BTC. how do I find out the transaction size? to know the actual commission amount?

  9. StasToken closed this on Dec 1, 2021

  10. DrahtBot locked this on Dec 1, 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