-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Avoid nullptr derefer when constr Blockchain & tx_memory_pool (Cont.) #8924
Avoid nullptr derefer when constr Blockchain & tx_memory_pool (Cont.) #8924
Conversation
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.
Thanks
@jeffro256 can you add DarkWingMcQuack as an author in git for the first commit? |
He should be the sole author of the first commit already, no? |
If you checkout the branch and do |
@jeffro256 sorry, it showed your profile picture that's why i got confused :) |
bf3359b
to
ffbf9f4
Compare
Sorry fixed a really small license year typo |
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.
Did you consider using a std::shared_ptr
instead? Or is the churn on that massive? It's would likely be annoying because one of them would have to be a std::weak_ptr
to break the cycle, causing more code churn.
This patch isn't perfect, but I think it does improve the code quality a bit.
One benefit of not using pointers is that you can allocate these objects on the stack, removing one layer of indirection. |
This PR replaces #8033 because it seems to be abandoned. Mine follows the same principle, but I extended the PR to enforce the usage of
BlockchainAndPool
throughout the codebase by making the constructors forBlockchain
andtx_memory_pool
private.