Skip to content
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

Confusion about peers. #11

Open
jordaniac89 opened this issue Jul 19, 2017 · 1 comment
Open

Confusion about peers. #11

jordaniac89 opened this issue Jul 19, 2017 · 1 comment

Comments

@jordaniac89
Copy link

In this example, I'm confused about what happens when you write a message to a peer in the broadcast function. Is there code behind the ports that handles the message? Or in this example, does the message just fall off?

@lhartikk
Copy link
Owner

The broadcast function send the given message to every peer the node knows about:

https://github.com/lhartikk/naivechain/blob/master/main.js#L206

The receiving peer handles the sent message using code:
https://github.com/lhartikk/naivechain/blob/master/main.js#L73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants