Make getblock return orphan blocks with confirmation: -1 #90

Closed
opened 2022-09-01 01:35:29 +02:00 by roylee17 · 0 comments
roylee17 commented 2022-09-01 01:35:29 +02:00 (Migrated from github.com)

Currently, orphan blocks and transactions are kept in the block database, but not available for query.

 lbcctl getblock 09555f547a4065b36561fbc3887023b3c97c592f6b77c5d9cb8adfbd0095eea8

-32603: block 09555f547a4065b36561fbc3887023b3c97c592f6b77c5d9cb8adfbd0095eea8 is not in the main chain

Some software like yiimp relies on this information to handle reorgs properly.

I don't have a orphan block at hand, but got a sample from other bitcoind-alike coin:

$ ./bin/DGB-cli getblock 4ad54d7ac4b421188085f029abd65ede86e94e83f73f35d69366c7cef9cecae7
{
  "hash": "4ad54d7ac4b421188085f029abd65ede86e94e83f73f35d69366c7cef9cecae7",
  "confirmations": -1,
  "strippedsize": 194,
  "size": 194,
  "weight": 776,
  "height": 15673117,
  "version": 536872962,
  "versionHex": "20000802",
  "pow_algo_id": 4,
  "pow_algo": "qubit",
  "pow_hash": "00000000000004b4de8617ec23ae5b41414c447e21bd28f96372d92e7cc25f04",
  "merkleroot": "4fc2feb6643fb003641979cd44fe55e6d1de6925d98465eb96092e4a6230d8b8",
  "tx": [
    "4fc2feb6643fb003641979cd44fe55e6d1de6925d98465eb96092e4a6230d8b8"
  ],
  "time": 1661833543,
  "mediantime": 1661833518,
  "nonce": 1676480887,
  "bits": "1a15fca8",
  "difficulty": 763042.1132930262,
  "chainwork": "0000000000000000000000000000000000000000000fcce720fc57df108155cc",
  "nTx": 1,
  "previousblockhash": "e81750620337f26d3c05cf0e064b4d3e2da6b98a6c05320b2c42477582d0ec09"
}

Making the orphan blocks returned with confirmation: -1 should make it compatible.

Currently, orphan blocks and transactions are kept in the block database, but not available for query. ```sh lbcctl getblock 09555f547a4065b36561fbc3887023b3c97c592f6b77c5d9cb8adfbd0095eea8 -32603: block 09555f547a4065b36561fbc3887023b3c97c592f6b77c5d9cb8adfbd0095eea8 is not in the main chain ``` Some software like yiimp relies on this information to handle reorgs properly. I don't have a orphan block at hand, but got a sample from other bitcoind-alike coin: ``` $ ./bin/DGB-cli getblock 4ad54d7ac4b421188085f029abd65ede86e94e83f73f35d69366c7cef9cecae7 ``` ```json { "hash": "4ad54d7ac4b421188085f029abd65ede86e94e83f73f35d69366c7cef9cecae7", "confirmations": -1, "strippedsize": 194, "size": 194, "weight": 776, "height": 15673117, "version": 536872962, "versionHex": "20000802", "pow_algo_id": 4, "pow_algo": "qubit", "pow_hash": "00000000000004b4de8617ec23ae5b41414c447e21bd28f96372d92e7cc25f04", "merkleroot": "4fc2feb6643fb003641979cd44fe55e6d1de6925d98465eb96092e4a6230d8b8", "tx": [ "4fc2feb6643fb003641979cd44fe55e6d1de6925d98465eb96092e4a6230d8b8" ], "time": 1661833543, "mediantime": 1661833518, "nonce": 1676480887, "bits": "1a15fca8", "difficulty": 763042.1132930262, "chainwork": "0000000000000000000000000000000000000000000fcce720fc57df108155cc", "nTx": 1, "previousblockhash": "e81750620337f26d3c05cf0e064b4d3e2da6b98a6c05320b2c42477582d0ec09" } ``` Making the orphan blocks returned with `confirmation: -1` should make it compatible.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbcd#90
No description provided.