Add several comments for exported constants.
This commit is contained in:
parent
d6752d8f99
commit
035a9c3dc3
2 changed files with 20 additions and 5 deletions
21
protocol.go
21
protocol.go
|
@ -10,11 +10,21 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MainPort = "8333"
|
// MainPort is the port used by default on the main network.
|
||||||
TestNetPort = "18333"
|
MainPort = "8333"
|
||||||
RegressionTestPort = "18444"
|
|
||||||
ProtocolVersion uint32 = 70001
|
// TestNetPort is the port used by default on the test network (version
|
||||||
TxVersion = 1
|
// 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
|
// MultipleAddressVersion is the protocol version which added multiple
|
||||||
// addresses per message (pver >= MultipleAddressVersion).
|
// addresses per message (pver >= MultipleAddressVersion).
|
||||||
|
@ -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
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue