rpc: Missing/wrong fields in getblocktemplate Result example #19625

issue stylesuxx opened this issue on July 30, 2020
  1. stylesuxx commented at 10:29 AM on July 30, 2020: contributor

    Invoking bitcoin-cli help getblocktemplate shows the following as example result:

    {                                 (json object)
      "version" : n,                  (numeric) The preferred block version
      "rules" : [                     (json array) specific block rules that are to be enforced
        "str",                        (string) rulename
        ...
      ],
      "vbavailable" : {               (json object) set of pending, supported versionbit (BIP 9) softfork deployments
        "rulename" : n,               (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule
        ...
      },
      "vbrequired" : n,               (numeric) bit mask of versionbits the server requires set in submissions
      "previousblockhash" : "str",    (string) The hash of current highest block
      "" : [                          (json array) contents of non-coinbase transactions that should be included in the next block
        {                             (json object)
          "data" : "hex",             (string) transaction data encoded in hexadecimal (byte-for-byte)
          "txid" : "hex",             (string) transaction id encoded in little-endian hexadecimal
          "hash" : "hex",             (string) hash encoded in little-endian hexadecimal (including witness data)
          "depends" : [               (json array) array of numbers
            n,                        (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is
            ...
          ],
          "fee" : n,                  (numeric) difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one
          "sigops" : n,               (numeric) total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero
          "weight" : n                (numeric) total transaction weight, as counted for purposes of block limits
        },
        ...
      ],
      "coinbaseaux" : {               (json object) data that should be included in the coinbase's scriptSig content
        ...
      },
      "coinbasevalue" : n,            (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)
      "coinbasetxn" : {               (json object) information for coinbase transaction
        ...
      },
      "target" : "str",               (string) The hash target
      "mintime" : xxx,                (numeric) The minimum timestamp appropriate for the next block time, expressed in UNIX epoch time
      "mutable" : [                   (json array) list of ways the block template may be changed
        "str",                        (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'
        ...
      ],
      "noncerange" : "hex",           (string) A range of valid nonces
      "sigoplimit" : n,               (numeric) limit of sigops in blocks
      "sizelimit" : n,                (numeric) limit of block size
      "weightlimit" : n,              (numeric) limit of block weight
      "curtime" : xxx,                (numeric) current timestamp in UNIX epoch time
      "bits" : "str",                 (string) compressed target of next block
      "height" : n                    (numeric) The height of the next block
    }
    

    actual result has more fields (capabilities, transactions(probably the field without a name), default_witness_commitment, longpollid) one field is missing (coinbasetxn):

    {
      "capabilities": [
        "proposal"
      ],
      "version": 536870912,
      "rules": [
        "csv",
        "!segwit"
      ],
      "vbavailable": {
      },
      "vbrequired": 0,
      "previousblockhash": "000000005b00d9476d756947955556e6db801c676e6650118d633e66e800b940",
      "transactions": [
        {
          "data": "02000000000106a84cea3a37cfe6a38c12fbf64761ac926c2f4ab05bbdac5b187e438f40860cc00000000017160014422b977c6a28f69359e2f0dfb6aa5197e466e5b8fdffffff33d588cec09c12f009fa9663a3db4390a4e8ddafe7d9a31092b3d$
          "txid": "9493cb4f621a1f95a264526f216914f741e6f01bff3dfdab5ab9ec81c3ce16a5",
          "hash": "543794756b046709b40c22ed9d0aa9492ef64e1f28d193a00efd6fd06e419f0a",
          "depends": [
          ],
          "fee": 133272,
          "sigops": 6,
          "weight": 2467
        },
        ...
      ],
      "coinbaseaux": {
      },
      "coinbasevalue": 19864212,
      "longpollid": "000000005b00d9476d756947955556e6db801c676e6650118d633e66e800b940529",
      "target": "000000000000000e7e1000000000000000000000000000000000000000000000",
      "mintime": 1596097882,
      "mutable": [
        "time",
        "transactions",
        "prevblock"
      ],
      "noncerange": "00000000ffffffff",
      "sigoplimit": 80000,
      "sizelimit": 4000000,
      "weightlimit": 4000000,
      "curtime": 1596104418,
      "bits": "190e7e10",
      "height": 1781942,
      "default_witness_commitment": "6a24aa21a9ed167e62a901109d5cbbc8d3892c8e12f66c2b52a8675df9bbb0b30fa2c033ae30"
    }
    
    
  2. fanquake added the label RPC/REST/ZMQ on Jul 30, 2020
  3. MarcoFalke added the label Docs on Jul 30, 2020
  4. jakeleventhal commented at 5:29 AM on July 31, 2020: contributor

    I can try to take this one (first issue)

  5. jakeleventhal referenced this in commit d2a0a3db66 on Aug 2, 2020
  6. jakeleventhal commented at 7:56 PM on August 2, 2020: contributor

    Created a pull request on this

  7. jakeleventhal referenced this in commit 25e6d090ac on Aug 2, 2020
  8. jakeleventhal commented at 11:54 PM on August 2, 2020: contributor

    https://travis-ci.org/github/bitcoin/bitcoin/jobs/714285265 build seems to be failing due to an apt issue? i dont have permission to rerun the build

  9. jakeleventhal referenced this in commit f61033fe50 on Aug 2, 2020
  10. jakeleventhal referenced this in commit dda89884dc on Aug 6, 2020
  11. jakeleventhal referenced this in commit fd07172e47 on Aug 6, 2020
  12. jakeleventhal referenced this in commit ce3e38568d on Aug 7, 2020
  13. jakeleventhal referenced this in commit 7c983d337b on Aug 7, 2020
  14. jakeleventhal referenced this in commit 1c028ff583 on Aug 9, 2020
  15. jakeleventhal referenced this in commit 50c087910d on Aug 11, 2020
  16. jakeleventhal referenced this in commit b908b2bf14 on Aug 11, 2020
  17. jakeleventhal referenced this in commit c91b241b48 on Aug 15, 2020
  18. laanwj closed this on Aug 28, 2020

  19. laanwj referenced this in commit 22acd36d53 on Aug 28, 2020
  20. sidhujag referenced this in commit 4ecbbea6ec on Aug 28, 2020
  21. DrahtBot locked this on Feb 15, 2022
  22. vijaydasmp referenced this in commit 7a00795815 on Apr 23, 2023
  23. vijaydasmp referenced this in commit 195221ae20 on May 3, 2023
  24. vijaydasmp referenced this in commit 80026844f6 on May 30, 2023

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-29 03:14 UTC

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