Conversation
cytadela8
commented
Nov 29, 2017
|
|
||
| if(block_hash == Base.encode16(peer_block_hash)) do | ||
| check_peer_block(peer_uri, peer_block.header.prev_hash, | ||
| check_peer_block(peer_uri, Serialization.hex_binary(deserialized_block.header.prev_hash, :serialize), |
Contributor
Author
There was a problem hiding this comment.
Here I had to do a little bit dirty fix, because we use hex encoded hashes in requests and hex encoded hash is passed to check_peer_block
Contributor
There was a problem hiding this comment.
internally I'd prefer to only pass binary, we should only introduce other encodings at the last point needed
thepiwo
reviewed
Nov 29, 2017
|
|
||
| ## Block was validated, now we can send it to other peers | ||
| Peers.broadcast_to_all({:new_block, block}) | ||
| Client.broadcast_block(block) |
Contributor
There was a problem hiding this comment.
I'd like to divide the client as much from the rest of the code as possible. Only the Peers Worker should know about the HTTP-Client Interface
thepiwo
reviewed
Nov 29, 2017
| case tx_pool == updated_pool do | ||
| true -> Logger.info(" This transaction already has been added") | ||
| false -> Peers.broadcast_to_all({:new_tx, tx}) | ||
| false -> Client.broadcast_tx(tx) |
Contributor
There was a problem hiding this comment.
Again, only the Peers should know about the Client
thepiwo
approved these changes
Dec 7, 2017
andonov
approved these changes
Dec 11, 2017
Contributor
|
@meivantodorov can you approve and merge? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR:
Aeutil.SerializationtoAehttpclientAehttpclientThis closes #114