Siacoin/Sia — pull request #75 by lukechampine (2014-04-17 05:14:57+00:00)
Title: Generalize networking

This PR adds a MessageSender interface, as requested in #72. This can be used to create a pseudo-network, which will allow us to simulate network actions without actually routing anything over TCP.

It also adds an Address struct, and overhauls most of the existing node.go code. Message types are handled by using the first byte of a payload as the key to a map of MessageHandler interfaces. To create a new message type, just add a key and corresponding interface to `TCPServer.MessageHandlers`.