Documentation ¶
Index ¶
- Variables
- type AlreadyPendingError
- type InvalidTypeError
- type Peer
- func (p *Peer) Close() error
- func (p *Peer) Connect(ctx context.Context) error
- func (p *Peer) FeeFilter() (*wire.MsgFeeFilter, error)
- func (p *Peer) GetAddr(ctx context.Context) (any, error)
- func (p *Peer) GetBlock(ctx context.Context, blockHash *chainhash.Hash) (*wire.MsgBlock, error)
- func (p *Peer) GetData(ctx context.Context, vector *wire.InvVect) (any, error)
- func (p *Peer) GetHeaders(ctx context.Context, hashes []*chainhash.Hash, stop *chainhash.Hash) (*wire.MsgHeaders, error)
- func (p *Peer) GetTx(ctx context.Context, txID *chainhash.Hash) (*wire.MsgTx, error)
- func (p *Peer) HasService(f wire.ServiceFlag) bool
- func (p *Peer) IsConnected() bool
- func (p *Peer) MemPool(ctx context.Context) (*wire.MsgInv, error)
- func (p *Peer) Ping(ctx context.Context, nonce uint64) (*wire.MsgPong, error)
- func (p *Peer) Remote() (*wire.MsgVersion, error)
- func (p *Peer) String() string
- type UnknownError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidType = new(InvalidTypeError) ErrAlreadyPending = new(AlreadyPendingError) ErrUnknown = new(UnknownError) )
Functions ¶
This section is empty.
Types ¶
type AlreadyPendingError ¶
type AlreadyPendingError struct {
// contains filtered or unexported fields
}
AlreadyPendingError is an error returned when a message is already pending and cannot be called more than once at a given time.
func (*AlreadyPendingError) Error ¶
func (e *AlreadyPendingError) Error() string
Error returns the error string.
type InvalidTypeError ¶
type InvalidTypeError struct {
// contains filtered or unexported fields
}
InvalidTypeError is an error returned when a message was received and was not of the expected type.
func (*InvalidTypeError) Error ¶
func (e *InvalidTypeError) Error() string
Error returns the error string.
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
func (*Peer) GetBlock ¶
GetBlock sends a getheaders(hash) call, then a getdata(hash) call to the peer and returns the block.
func (*Peer) GetHeaders ¶
func (p *Peer) GetHeaders(ctx context.Context, hashes []*chainhash.Hash, stop *chainhash.Hash) (*wire.MsgHeaders, error)
GetHeaders writes a getheaders message to the peer and returns the headers.
func (*Peer) HasService ¶
func (p *Peer) HasService(f wire.ServiceFlag) bool
func (*Peer) IsConnected ¶
type UnknownError ¶
type UnknownError struct {
// contains filtered or unexported fields
}
UnknownError is an error returned when the requested data cannot be found.
Click to show internal directories.
Click to hide internal directories.