Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.
Types ¶
type Config ¶
type Config struct { // OnVersion is invoked when a peer receives a version message. OnVersion func(*Peer, *msg.Version) // After send a blocks request message, this inventory message // will return with a bunch of block hashes, then you can use them // to request all the blocks by send data requests. OnInv func(*Peer, *msg.Inv) // This method will be invoked when a merkleblock and transactions // within it has been downloaded. OnBlock func(*Peer, *util.Block) // After sent a data request with invType TRANSACTION, a txn message will return through this method. // these transactions are matched to the bloom filter you have sent with the filterload message. OnTx func(*Peer, util.Transaction) // If the BLOCK or TRANSACTION requested by the data request message can not be found, // notfound message with requested data hash will return through this method. OnNotFound func(*Peer, *msg.NotFound) // If the submitted transaction was rejected, this message will return. OnReject func(*Peer, *msg.Reject) }
Config is the struct to hold configuration options useful to Peer.
type Peer ¶
func (*Peer) PushGetBlocksMsg ¶
PushGetBlocksMsg sends a getblocks message for the provided block locator and stop hash. It will ignore back-to-back duplicate requests.
This function is safe for concurrent access.
func (*Peer) StallClear ¶
func (p *Peer) StallClear()
Click to show internal directories.
Click to hide internal directories.