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

issue stylesuxx openend 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:

     0{                                 (json object)
     1  "version" : n,                  (numeric) The preferred block version
     2  "rules" : [                     (json array) specific block rules that are to be enforced
     3    "str",                        (string) rulename
     4    ...
     5  ],
     6  "vbavailable" : {               (json object) set of pending, supported versionbit (BIP 9) softfork deployments
     7    "rulename" : n,               (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule
     8    ...
     9  },
    10  "vbrequired" : n,               (numeric) bit mask of versionbits the server requires set in submissions
    11  "previousblockhash" : "str",    (string) The hash of current highest block
    12  "" : [                          (json array) contents of non-coinbase transactions that should be included in the next block
    13    {                             (json object)
    14      "data" : "hex",             (string) transaction data encoded in hexadecimal (byte-for-byte)
    15      "txid" : "hex",             (string) transaction id encoded in little-endian hexadecimal
    16      "hash" : "hex",             (string) hash encoded in little-endian hexadecimal (including witness data)
    17      "depends" : [               (json array) array of numbers
    18        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
    19        ...
    20      ],
    21      "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
    22      "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
    23      "weight" : n                (numeric) total transaction weight, as counted for purposes of block limits
    24    },
    25    ...
    26  ],
    27  "coinbaseaux" : {               (json object) data that should be included in the coinbase's scriptSig content
    28    ...
    29  },
    30  "coinbasevalue" : n,            (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)
    31  "coinbasetxn" : {               (json object) information for coinbase transaction
    32    ...
    33  },
    34  "target" : "str",               (string) The hash target
    35  "mintime" : xxx,                (numeric) The minimum timestamp appropriate for the next block time, expressed in UNIX epoch time
    36  "mutable" : [                   (json array) list of ways the block template may be changed
    37    "str",                        (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'
    38    ...
    39  ],
    40  "noncerange" : "hex",           (string) A range of valid nonces
    41  "sigoplimit" : n,               (numeric) limit of sigops in blocks
    42  "sizelimit" : n,                (numeric) limit of block size
    43  "weightlimit" : n,              (numeric) limit of block weight
    44  "curtime" : xxx,                (numeric) current timestamp in UNIX epoch time
    45  "bits" : "str",                 (string) compressed target of next block
    46  "height" : n                    (numeric) The height of the next block
    47}
    

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

     0{
     1  "capabilities": [
     2    "proposal"
     3  ],
     4  "version": 536870912,
     5  "rules": [
     6    "csv",
     7    "!segwit"
     8  ],
     9  "vbavailable": {
    10  },
    11  "vbrequired": 0,
    12  "previousblockhash": "000000005b00d9476d756947955556e6db801c676e6650118d633e66e800b940",
    13  "transactions": [
    14    {
    15      "data": "02000000000106a84cea3a37cfe6a38c12fbf64761ac926c2f4ab05bbdac5b187e438f40860cc00000000017160014422b977c6a28f69359e2f0dfb6aa5197e466e5b8fdffffff33d588cec09c12f009fa9663a3db4390a4e8ddafe7d9a31092b3d$
    16      "txid": "9493cb4f621a1f95a264526f216914f741e6f01bff3dfdab5ab9ec81c3ce16a5",
    17      "hash": "543794756b046709b40c22ed9d0aa9492ef64e1f28d193a00efd6fd06e419f0a",
    18      "depends": [
    19      ],
    20      "fee": 133272,
    21      "sigops": 6,
    22      "weight": 2467
    23    },
    24    ...
    25  ],
    26  "coinbaseaux": {
    27  },
    28  "coinbasevalue": 19864212,
    29  "longpollid": "000000005b00d9476d756947955556e6db801c676e6650118d633e66e800b940529",
    30  "target": "000000000000000e7e1000000000000000000000000000000000000000000000",
    31  "mintime": 1596097882,
    32  "mutable": [
    33    "time",
    34    "transactions",
    35    "prevblock"
    36  ],
    37  "noncerange": "00000000ffffffff",
    38  "sigoplimit": 80000,
    39  "sizelimit": 4000000,
    40  "weightlimit": 4000000,
    41  "curtime": 1596104418,
    42  "bits": "190e7e10",
    43  "height": 1781942,
    44  "default_witness_commitment": "6a24aa21a9ed167e62a901109d5cbbc8d3892c8e12f66c2b52a8675df9bbb0b30fa2c033ae30"
    45}
    
  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: 2024-12-22 03:12 UTC

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