Add several comments for exported constants.

This commit is contained in:
Dave Collins 2013-07-27 16:31:47 -05:00
parent d6752d8f99
commit 035a9c3dc3
2 changed files with 20 additions and 5 deletions

View File

@ -10,10 +10,20 @@ import (
) )
const ( const (
// MainPort is the port used by default on the main network.
MainPort = "8333" MainPort = "8333"
// TestNetPort is the port used by default on the test network (version
// 3).
TestNetPort = "18333" TestNetPort = "18333"
// RegressionTestPort is the port used by default on the regression test
// network.
RegressionTestPort = "18444" RegressionTestPort = "18444"
// ProtocolVersion is the latest protocol version this package supports.
ProtocolVersion uint32 = 70001 ProtocolVersion uint32 = 70001
TxVersion = 1 TxVersion = 1
// MultipleAddressVersion is the protocol version which added multiple // MultipleAddressVersion is the protocol version which added multiple
@ -42,6 +52,7 @@ const (
type ServiceFlag uint64 type ServiceFlag uint64
const ( const (
// SFNodeNetwork is a flag used to indicate a peer is a full node.
SFNodeNetwork ServiceFlag = 1 << iota SFNodeNetwork ServiceFlag = 1 << iota
) )

View File

@ -12,8 +12,12 @@ import (
// Size of array used to store sha hashes. See ShaHash. // Size of array used to store sha hashes. See ShaHash.
const HashSize = 32 const HashSize = 32
// MaxHashStringSize is the maximum length of a ShaHash hash string.
const MaxHashStringSize = HashSize * 2 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) var ErrHashStrSize = fmt.Errorf("Max hash length is %v chars", MaxHashStringSize)
// ShaHash is used in several of the bitcoin messages and common structures. It // ShaHash is used in several of the bitcoin messages and common structures. It