diff --git a/protocol.go b/protocol.go index 2d4d9e2b..1e5c8ede 100644 --- a/protocol.go +++ b/protocol.go @@ -10,11 +10,21 @@ import ( ) const ( - MainPort = "8333" - TestNetPort = "18333" - RegressionTestPort = "18444" - ProtocolVersion uint32 = 70001 - TxVersion = 1 + // MainPort is the port used by default on the main network. + MainPort = "8333" + + // TestNetPort is the port used by default on the test network (version + // 3). + TestNetPort = "18333" + + // RegressionTestPort is the port used by default on the regression test + // network. + RegressionTestPort = "18444" + + // ProtocolVersion is the latest protocol version this package supports. + ProtocolVersion uint32 = 70001 + + TxVersion = 1 // MultipleAddressVersion is the protocol version which added multiple // addresses per message (pver >= MultipleAddressVersion). @@ -42,6 +52,7 @@ const ( type ServiceFlag uint64 const ( + // SFNodeNetwork is a flag used to indicate a peer is a full node. SFNodeNetwork ServiceFlag = 1 << iota ) diff --git a/shahash.go b/shahash.go index 090b2e41..a3966bbf 100644 --- a/shahash.go +++ b/shahash.go @@ -12,8 +12,12 @@ import ( // Size of array used to store sha hashes. See ShaHash. const HashSize = 32 + +// MaxHashStringSize is the maximum length of a ShaHash hash string. const MaxHashStringSize = HashSize * 2 +// ErrHashStrSize describes an error that indicates the caller specified a hash +// string that has too many characters. var ErrHashStrSize = fmt.Errorf("Max hash length is %v chars", MaxHashStringSize) // ShaHash is used in several of the bitcoin messages and common structures. It