-
Notifications
You must be signed in to change notification settings - Fork 790
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
Add receive_hash option for the blocks_info RPC #3702
Add receive_hash option for the blocks_info RPC #3702
Conversation
0174324
to
25c565a
Compare
@dsiganos * Fixed clang format |
25c565a
to
4ca8e76
Compare
Small consistency update: In case no receive block is found the full zero hash is now returned instead of just "0" (similar to the "successor" field). |
@Exxenoz I made some improvements. PLease review, if possible. |
Looks good to me. 👍 |
nano/node/node.cpp
Outdated
@@ -1774,6 +1774,54 @@ void nano::node::populate_backlog () | |||
} | |||
} | |||
|
|||
/** Given the block hash of a send block, find the associated receive block that receives that send. |
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.
IMO, this function should be packed into the ledger.cpp file, or in another more specific file, if there is a better one. This is more related to the ledger logic and the node is a more general class.
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.
I agree. But I do not yet understand how the database classes are structured and I don't know how to do that.
So I have taken the easy and slightly less accurate route of implementing in the node class.
We can work on this together to improve it, if you like.
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.
My preference is to send the function to json_handler.cpp
as it isn't used anywhere else, but as you @dsiganos foresee other usages, so let's keep the function in the ledger class, as it is also better for unit test access.
434045f
to
48b8966
Compare
This PR couldn't be merged because it was conflicting. |
Added the function nano::node::find_receive_block_by_send_hash to find the receive block linked with a send block for better code reuse. Co-authored-by: Dimitrios Siganos <[email protected]> Co-authored-by: Thiago Silva <[email protected]>
48b8966
to
77c9fda
Compare
Closes #3701