-
Notifications
You must be signed in to change notification settings - Fork 152
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
Do not append genesis during fork #1063
Do not append genesis during fork #1063
Conversation
Libplanet/Blockchain/BlockChain.cs
Outdated
renderActions: !inFork, | ||
evaluateActions: !inFork | ||
); | ||
if (!inFork) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How merge if statements?
if (!inFork) | |
if (count == 0 && !inFork) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will throw exception in next else if
statement 😢
Libplanet/Blockchain/BlockChain.cs
Outdated
if (Count == 0) | ||
{ | ||
Append( | ||
genesisBlock, | ||
currentTime: genesisBlock.Timestamp, | ||
renderBlocks: !inFork, | ||
renderActions: !inFork, | ||
evaluateActions: !inFork | ||
); | ||
if (!inFork) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about merging two conditions into one using an &&
operator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, fair enough. Never mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will throw exception in next else if statement 😢
b84b871
to
e5ca06e
Compare
I made constructor of |
e5ca06e
to
534d8a5
Compare
Codecov Report
@@ Coverage Diff @@
## 9c-main #1063 +/- ##
===========================================
- Coverage 88.44% 88.37% -0.07%
===========================================
Files 343 343
Lines 31490 31494 +4
===========================================
- Hits 27850 27834 -16
- Misses 1962 1980 +18
- Partials 1678 1680 +2
|
InsteadIStore.ForkBlockIndexes()
became to iterate from 0 (was 1).Instead just append its index only.