Conversation
|
We might want to see if there is a yaci config that can help test this before we merge it. |
lib/chain_sync.ex
Outdated
|
|
||
| case CSResponse.decode(combined_payload) do | ||
| {:ok, %AwaitReply{}} -> | ||
| :ok = setopts_lib(client).setopts(socket, active: :once) |
There was a problem hiding this comment.
The reason for setting the socket to active here and then below is that we need it to be after invoking the read_remaining_payload function. Notice that line 277 manually calls client.recv(socket, recv_payload_length, @recv_timeout)
I'm running this branch and don't see new blocks displayed so I suspect the changes break the current functionality.
There was a problem hiding this comment.
Interesting, it was testing out for me. Am I missing something?
Even so, what you say makes sense and I realizing this probably isn't what this comment is talking about:
https://github.com/wowica/xander/pull/48/files#diff-61848f9c738b8acca1018367012bcf6f97ca7ac8de8e8a6efbcbf2df4765d5f5L397
Not sure I understand the scenario. Left a comment on the code but am curious to hear more about the issue you had in mind. |
I was looking to resolve the bug mentioned here: Regardless of the comment above, I think I misinterpreted what the TODO was saying. The issue isn't that there's a period of time in the I've made a commit that should be closer to an actual solution for the problem for discussion purposes. The code is redundant and would need to be DRYed up, but right now I'm just trying to make sure it's addressing the actual issue. |
Fixes the bug where a received message could be processed by the socket while in a state not meant for message processing.