Add `paytxfee` and `errors` JSON fields where appropriate #6257

pull scmorse wants to merge 1 commits into bitcoin:master from scmorse:TxFeeRpc changing 3 files +5 −1
  1. scmorse commented at 9:31 PM on June 8, 2015: none

    Added fields that were missing from a few of the basic info rpc requests.

    getwalletinfo

    • paytxfee

    getnetworkinfo

    • warnings
  2. jonasschnelli commented at 12:04 PM on June 9, 2015: contributor

    utACK for the paytxfee in getwalletinfo.

    Tend to NACK the errors extending. The errors are mostly warnings and i think it won't make sense to add them to serval rpc commands. I think a good example of how the errors field could get handled is the signrawtransaction rpc call. The getinfo rpc call is not e good example IMO.

  3. laanwj commented at 12:25 PM on June 9, 2015: member

    @jonasschnelli I agree that errors shouldn't be added to multiple RPC calls. It does belong on one other RPC call though as otherwise it would disappear when the deprecated getinfo is removed. (same for version, and protocolversion)

    Edit: protocolversion is already on getnetworkinfo, I forgot.

  4. jonasschnelli commented at 12:28 PM on June 9, 2015: contributor

    It just came to my mind that there is also the possibility of adding general information "one level above JSON" and that would mean add a custom HTTP response header (X-Bitcoin-Version, etc.). But not sure if this is a good idea.

  5. laanwj added the label RPC on Jun 9, 2015
  6. laanwj commented at 12:33 PM on June 9, 2015: member

    @jonasschnelli Sounds like a good idea, but it may be harder to get at in some client implementations. It doesn't exclude including the version on some RPC call.

  7. scmorse commented at 2:01 PM on June 9, 2015: none

    @jonasschnelli which one RPC call do you think the errors flag from getinfo should be included in, then? Maybe errors isn't the best name, could be alert or alerts?

  8. jonasschnelli commented at 2:06 PM on June 9, 2015: contributor

    @scmorse: at the moment, the general error states (actually mostly warnings) can be loaded over the getinfo() call (which is okay IMO). It should be named "warnings", but changing this would break the API (which should be avoided).

    My recommendation would be to just add the paytxfee field as you did and remove all the "error" changes. Or do you see a benefit in having the error object in getblockchaininfo and getnetworkinfo?

  9. laanwj commented at 8:00 AM on June 10, 2015: member

    Let's put it in getnetworkinfo. Nearly all the alerts come from the network or at least signal network conditions.

  10. Add paytxfee to getwalletinfo, warnings to getnetworkinfo ef2a3de25c
  11. scmorse force-pushed on Jun 11, 2015
  12. scmorse commented at 8:15 PM on June 11, 2015: none

    @laanwj @jonasschnelli Updated getnetworkinfo to have a "warnings" field and getwalletinfo to include the "paytxfee".

  13. jonasschnelli commented at 8:18 PM on June 11, 2015: contributor

    utACK.

    Something for another PR would be to rename the "statusbar" warnings category to just "status" or something to avoid that one could think this is for UI only. But really really a minor low prio thing.

  14. laanwj commented at 1:00 PM on June 12, 2015: member

    utACK.

    I'd say don't bother renaming the category in this pull. I agree it's named wrongly and it's weird to pass in a string there anyway (should be an enum). Also the other category "rpc" is never used except to detect "safe mode" in OnRPCPreCommand by checking if the string is empty, which is also quite strange. It's very weird code so renaming the category wouldn't do it justice :)

  15. laanwj merged this on Jun 15, 2015
  16. laanwj closed this on Jun 15, 2015

  17. laanwj referenced this in commit 5ebe7db6d0 on Jun 15, 2015
  18. zkbot referenced this in commit 9af55822fb on Feb 15, 2017
  19. zkbot referenced this in commit a7cf698873 on Mar 4, 2017
  20. MarcoFalke locked this on Sep 8, 2021

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:15 UTC

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