2

getblockheaderbyheight and any other simmilar calls only returns the data below. None of the other calls returns the txFee of the block

{
  "id": "0",
  "jsonrpc": "2.0",
  "result": {
    "block_header": {
      "depth": 78376,
      "difficulty": 815625611,
      "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6",
      "height": 912345,
      "major_version": 1,
      "minor_version": 2,
      "nonce": 1646,
      "orphan_status": false,
      "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78",
      "reward": 7388968946286,
      "timestamp": 1452793716
    },
    "status": "OK"
  }
}
kuchi
  • 123
  • 3

1 Answers1

2

Presumably you'd have to use the getblock method to get the transactions also and then iterate the transactions to add up total fees of a block.

Update: doc

jtgrassie
  • 19,111
  • 4
  • 14
  • 51
  • Thanks. I just saw the explorer's source code and that's how they get the total fee. They iterate through all the transactions and then increment the sum_fees – kuchi May 24 '18 at 17:00