Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transactionCount is 0 #18

Open
Klar opened this issue Aug 15, 2022 · 4 comments
Open

transactionCount is 0 #18

Klar opened this issue Aug 15, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Klar
Copy link

Klar commented Aug 15, 2022

transactionCount is always 0, block-headers-client seems to be synced i.e latest block.

curl localhost:8080/api/v1/chain/header/byHeight?height=111 | jq
[
{
"hash": "000000004d6a6dd8b882deec7b54421949dddd2c166bd51ee7f62a52091a6c35",
"version": 1,
"prevBlockHash": "00000000a30e366158a1813a6fda9f913497000a68f1c008b9f935b866cee55b",
"merkleRoot": "e7a3e246c6f2d582b089d7d6c2f925e8aae46ef0c0ce97d3dd3afe3016a44e97",
"creationTimestamp": 1231669673,
"difficultyTarget": 486604799,
"nonce": 4076340484,
"transactionCount": 0,
"work": 4295032833
}
]

curl localhost:8080/api/v1/chain/header/byHeight?height=53632 | jq
[
{
"hash": "0000000007e3599bd68f98d157d3f20c2f7bfd20425e75e4f240601136721243",
"version": 1,
"prevBlockHash": "000000000a092c00132d96afc15c71f4d9b7102a22aff200e379652823bfd0c7",
"merkleRoot": "c5e25d3bdf874b3fb22a23e4f6a41b064dbc35cde523d7502e073e6258dd2f8e",
"creationTimestamp": 1272529571,
"difficultyTarget": 471225455,
"nonce": 205556418,
"transactionCount": 0,
"work": 49239612792
}
]

curl localhost:8080/api/v1/chain/tips | jq
[
{
"header": {
"hash": "000000000000000005a6f74c10a5475c91c83aa04315c0724c91a18337af3f42",
"version": 1073733632,
"prevBlockHash": "000000000000000009a58b63f26498fa69077d31385dc7b815d8ee9aeb5a6ec6",
"merkleRoot": "cf3272201f9d3af64593ad1b5b5d153e7f1fbb4633b490d60cfe74b96455f1d9",
"creationTimestamp": 1660569967,
"difficultyTarget": 403624649,
"nonce": 821452442,
"transactionCount": 0,
"work": 318575563526575900000
},
"state": "LONGEST_CHAIN",
"chainWork": 380740663188207560000000000,
"height": 752808,
"confirmations": 1
}
]

@Klar
Copy link
Author

Klar commented May 31, 2023

bump

@Danconnolly Danconnolly self-assigned this Jun 5, 2023
@Danconnolly
Copy link
Contributor

Confirmed in version 2.0.4, confirmed in version 1.0.0.

@Danconnolly
Copy link
Contributor

It is not possible to determine the number of transactions in a block using SPV. To determine the number of transactions in a block using the existing P2P protocol, one would have to download the whole block. This would be inconsistent with the principles of SPV.

This field should not have been added to the result set. It will be removed. However, to do so would be a change in the API, so this change will only occur during the release of the next major version. This bug is in itself not enough to trigger the release of a new major version.

So, this bug will remain for now.

I've added a backlog item to implement this bugfix #24

@Danconnolly
Copy link
Contributor

This ticket should remain open until the bug is fixed for visibility.

@Danconnolly Danconnolly added the bug Something isn't working label Jun 5, 2023
@Danconnolly Danconnolly added this to the Major Release v3.0.0 milestone Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants