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

blockchain: Trsy always inactive for genesis blk. #2636

Merged

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Apr 20, 2021

This modifies the IsTreasuryAgendaActive method to return false when a zero hash is provided since that indicates the next block is the genesis block and the treasury agenda is always inactive for the genesis block.

This has the effect of fixing a few RPC handlers, such as getblock, when working with the genesis block.

Fixes #2635.

@davecgh davecgh added this to the 1.7.0 milestone Apr 20, 2021
Copy link
Member

@JoeGruffins JoeGruffins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getblock 298e5cc3d985bfe7f81dc135f360abe089edd4396b86d2de66b0cef42b21d980
{
  "hash": "298e5cc3d985bfe7f81dc135f360abe089edd4396b86d2de66b0cef42b21d980",
  "confirmations": 547331,
  "size": 0,
  "height": 0,
  "version": 1,
  "merkleroot": "66aa7491b9adce110585ccab7e3fb5fe280de174530cca10eba2c6c3df01c10d",
  "stakeroot": "0000000000000000000000000000000000000000000000000000000000000000",
  "tx": [
    "e7dfbceac9fccd6025c70a1dfa9302b3e7b5aa22fa51c98a69164ad403d60a2c"
  ],
  "time": 1454954400,
  "nonce": 0,
  "votebits": 0,
  "finalstate": "000000000000",
  "voters": 0,
  "freshstake": 0,
  "revocations": 0,
  "poolsize": 0,
  "bits": "1b01ffff",
  "sbits": 2,
  "extradata": "0000000000000000000000000000000000000000000000000000000000000000",
  "stakeversion": 0,
  "difficulty": 32767.74999809,
  "chainwork": "0000000000000000000000000000000000000000000000000000800040002000",
  "previousblockhash": "0000000000000000000000000000000000000000000000000000000000000000",
  "nextblockhash": "000000000000437482b6d47f82f374cde539440ddb108b0a76886f0d87d126b9"
}

This modifies the IsTreasuryAgendaActive method to return false when a
zero hash is provided since that indicates the next block is the genesis
block and the treasury agenda is always inactive for the genesis block.

This has the effect of fixing a few RPC handlers, such as getblock, when
working with the genesis block.
@davecgh davecgh force-pushed the blockchain_treasury_inactive_genesis_block branch from aabb35e to 02567db Compare April 22, 2021 17:26
@davecgh davecgh merged commit 02567db into decred:master Apr 27, 2021
@davecgh davecgh deleted the blockchain_treasury_inactive_genesis_block branch April 27, 2021 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getblock: Unable to retrieve the genesis block.
3 participants