dvf / blockchain-book

208 stars 71 forks source link

Initialising p2p_protocol with self. #2

Open doneforaiur opened 3 years ago

doneforaiur commented 3 years ago

I got the error stating that handle_message missing positional argument writer but writer is supplied to the function. It seems that handle_message can't get self, that is p2p_protocol.

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

I've changed this section to self.p2p_protocol = p2p_protocol(self) and it's working as intended. Is this normal or am I missing something?

Jmallone commented 3 years ago

I had the same problem, your solution helped me