Add receive_hash option for the blocks_info RPC#3702
Add receive_hash option for the blocks_info RPC#3702dsiganos merged 1 commit intonanocurrency:developfrom
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
| } | ||
| } | ||
|
|
||
| /** Given the block hash of a send block, find the associated receive block that receives that send. |
There was a problem hiding this comment.
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.
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.
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 <dimitris@siganos.org> Co-authored-by: Thiago Silva <thiago@nano.org>
48b8966 to
77c9fda
Compare
Closes #3701