Versions in this module Expand all Collapse all v0 v0.0.1 Dec 19, 2019 Changes in this version + const DefaultTrickleInterval + const MaxProtocolVersion + const MinAcceptableProtocolVersion + func DisableLog() + func UseLogger(logger btclog.Logger) + type AddrFunc func(remoteAddr *wire.NetAddress) *wire.NetAddress + type Config struct + ChainParams *chaincfg.Params + DisableRelayTx bool + HostToNetAddress HostToNetAddrFunc + Listeners MessageListeners + NewestBlock HashFunc + ProtocolVersion uint32 + Proxy string + Services wire.ServiceFlag + TrickleInterval time.Duration + UserAgentComments []string + UserAgentName string + UserAgentVersion string + type HashFunc func() (hash *chainhash.Hash, height int32, err error) + type HostToNetAddrFunc func(host string, port uint16, services wire.ServiceFlag) (*wire.NetAddress, error) + type MessageListeners struct + OnAddr func(p *Peer, msg *wire.MsgAddr) + OnAlert func(p *Peer, msg *wire.MsgAlert) + OnBlock func(p *Peer, msg *wire.MsgBlock, buf []byte) + OnCFCheckpt func(p *Peer, msg *wire.MsgCFCheckpt) + OnCFHeaders func(p *Peer, msg *wire.MsgCFHeaders) + OnCFilter func(p *Peer, msg *wire.MsgCFilter) + OnFeeFilter func(p *Peer, msg *wire.MsgFeeFilter) + OnFilterAdd func(p *Peer, msg *wire.MsgFilterAdd) + OnFilterClear func(p *Peer, msg *wire.MsgFilterClear) + OnFilterLoad func(p *Peer, msg *wire.MsgFilterLoad) + OnGetAddr func(p *Peer, msg *wire.MsgGetAddr) + OnGetBlocks func(p *Peer, msg *wire.MsgGetBlocks) + OnGetCFCheckpt func(p *Peer, msg *wire.MsgGetCFCheckpt) + OnGetCFHeaders func(p *Peer, msg *wire.MsgGetCFHeaders) + OnGetCFilters func(p *Peer, msg *wire.MsgGetCFilters) + OnGetData func(p *Peer, msg *wire.MsgGetData) + OnGetHeaders func(p *Peer, msg *wire.MsgGetHeaders) + OnHeaders func(p *Peer, msg *wire.MsgHeaders) + OnInv func(p *Peer, msg *wire.MsgInv) + OnMemPool func(p *Peer, msg *wire.MsgMemPool) + OnMerkleBlock func(p *Peer, msg *wire.MsgMerkleBlock) + OnNotFound func(p *Peer, msg *wire.MsgNotFound) + OnPing func(p *Peer, msg *wire.MsgPing) + OnPong func(p *Peer, msg *wire.MsgPong) + OnRead func(p *Peer, bytesRead int, msg wire.Message, err error) + OnReject func(p *Peer, msg *wire.MsgReject) + OnSendHeaders func(p *Peer, msg *wire.MsgSendHeaders) + OnTx func(p *Peer, msg *wire.MsgTx) + OnVerAck func(p *Peer, msg *wire.MsgVerAck) + OnVersion func(p *Peer, msg *wire.MsgVersion) *wire.MsgReject + OnWrite func(p *Peer, bytesWritten int, msg wire.Message, err error) + type Peer struct + func NewInboundPeer(cfg *Config) *Peer + func NewOutboundPeer(cfg *Config, addr string) (*Peer, error) + func (p *Peer) AddKnownInventory(invVect *wire.InvVect) + func (p *Peer) Addr() string + func (p *Peer) AssociateConnection(conn net.Conn) + func (p *Peer) BytesReceived() uint64 + func (p *Peer) BytesSent() uint64 + func (p *Peer) Connected() bool + func (p *Peer) Disconnect() + func (p *Peer) ID() int32 + func (p *Peer) Inbound() bool + func (p *Peer) IsWitnessEnabled() bool + func (p *Peer) LastAnnouncedBlock() *chainhash.Hash + func (p *Peer) LastBlock() int32 + func (p *Peer) LastPingMicros() int64 + func (p *Peer) LastPingNonce() uint64 + func (p *Peer) LastPingTime() time.Time + func (p *Peer) LastRecv() time.Time + func (p *Peer) LastSend() time.Time + func (p *Peer) LocalAddr() net.Addr + func (p *Peer) NA() *wire.NetAddress + func (p *Peer) ProtocolVersion() uint32 + func (p *Peer) PushAddrMsg(addresses []*wire.NetAddress) ([]*wire.NetAddress, error) + func (p *Peer) PushGetBlocksMsg(locator blockchain.BlockLocator, stopHash *chainhash.Hash) error + func (p *Peer) PushGetHeadersMsg(locator blockchain.BlockLocator, stopHash *chainhash.Hash) error + func (p *Peer) PushRejectMsg(command string, code wire.RejectCode, reason string, hash *chainhash.Hash, ...) + func (p *Peer) QueueInventory(invVect *wire.InvVect) + func (p *Peer) QueueMessage(msg wire.Message, doneChan chan<- struct{}) + func (p *Peer) QueueMessageWithEncoding(msg wire.Message, doneChan chan<- struct{}, encoding wire.MessageEncoding) + func (p *Peer) Services() wire.ServiceFlag + func (p *Peer) StartingHeight() int32 + func (p *Peer) StatsSnapshot() *StatsSnap + func (p *Peer) String() string + func (p *Peer) TimeConnected() time.Time + func (p *Peer) TimeOffset() int64 + func (p *Peer) UpdateLastAnnouncedBlock(blkHash *chainhash.Hash) + func (p *Peer) UpdateLastBlockHeight(newHeight int32) + func (p *Peer) UserAgent() string + func (p *Peer) VerAckReceived() bool + func (p *Peer) VersionKnown() bool + func (p *Peer) WaitForDisconnect() + func (p *Peer) WantsHeaders() bool + type StatsSnap struct + Addr string + BytesRecv uint64 + BytesSent uint64 + ConnTime time.Time + ID int32 + Inbound bool + LastBlock int32 + LastPingMicros int64 + LastPingNonce uint64 + LastPingTime time.Time + LastRecv time.Time + LastSend time.Time + Services wire.ServiceFlag + StartingHeight int32 + TimeOffset int64 + UserAgent string + Version uint32