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

BUG - prevBlock null #443

Open
cdrcools opened this issue Feb 25, 2023 · 3 comments
Open

BUG - prevBlock null #443

cdrcools opened this issue Feb 25, 2023 · 3 comments

Comments

@cdrcools
Copy link

"Base\Deployments\ThresholdConditionCache.cs" line 89

indexPrev is null when height is 0
Not an issue unless your starting fresh.

@dangershony
Copy link
Member

ah I see are you able to propose a fix and open a PR?

@cdrcools
Copy link
Author

cdrcools commented Mar 1, 2023

Came up with a quick workaround on the calling method
Old
List metrics = ruleEngine.NodeDeployments.BIP9.GetThresholdStateMetrics(this.ChainState.ConsensusTip.Previous, thresholdStates);

New
List metrics = ruleEngine.NodeDeployments.BIP9.GetThresholdStateMetrics(this.ChainState.ConsensusTip.Previous ?? this.ChainState.ConsensusTip, thresholdStates);

Works for me

@dangershony
Copy link
Member

ok looks fine please make a PR

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

No branches or pull requests

2 participants