-
Notifications
You must be signed in to change notification settings - Fork 293
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
multi: remove chainState deps in server & cpuminer. #1419
multi: remove chainState deps in server & cpuminer. #1419
Conversation
88cebec
to
b837015
Compare
b837015
to
5de2819
Compare
mempool/mempool.go
Outdated
// | ||
// TODO: Ideally this would not return an error, but changing the function | ||
// would require a major version bump to the mempool module. | ||
// The next time a major version is released, the error should be removed. |
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.
While this is true for the particular implementation currently used in this PR, the point of decoupling the structures by using a function reference is that you don't need to know whether the impl returns an error or not. So I'd say that you should just maintain this function signature and the subsequent error checking.
mining.go
Outdated
best := blockManager.chain.BestSnapshot() | ||
prevHash := best.Hash | ||
nextBlockHeight := best.Height + 1 | ||
if prevHash != best.Hash || |
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.
Does this check make sense, given that you just set prevHash := best.Hash
? What could cause them to not be equal?
It seems that given you're now using BestSnapshot
exclusively (vs using chainState
) this whole test can be dropped as it doesn't make sense anymore (bestSnapshot
should not change during its lifetime).
0a3cef6
to
b1c75f2
Compare
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.
The commit title does not follow the guidelines.
b1c75f2
to
346e582
Compare
346e582
to
c0b0b6c
Compare
This PR requires #1417 and #1418.
Port of upstream commit 2274d36 (subset). In preparation of the
removal of chainState.