dvf / blockchain-book

210 stars 68 forks source link

"Messaging Protocol" sent incorrectly #5

Open Jmallone opened 3 years ago

Jmallone commented 3 years ago

https://github.com/dvf/blockchain-book/blob/8642a7b55b1b14be40e243cf004051d4f200d4b5/chapters/chapter_7/funcoin/peers.py#L38

In this piece of code above, the struct for var "message' doesn't have "name" because in server.py, it pass different with "meta" and "message"

https://github.com/dvf/blockchain-book/blob/8642a7b55b1b14be40e243cf004051d4f200d4b5/chapters/chapter_7/funcoin/server.py#L30

i'm fix it with:

message = message['message']
handler = message_handlers.get(message["name"]) 

added this above in line 38 in peers.py

Leonyxtested commented 3 years ago

Thank