objmgr

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2017 License: ISC Imports: 12 Imported by: 0

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.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using btclog.

Types

type ObjectManager

type ObjectManager struct {
	// contains filtered or unexported fields
}

ObjectManager provides a concurrency safe object manager for handling all incoming and outgoing.

func NewObjectManager

func NewObjectManager(s server, db database.Db, requestExpire, cleanupInterval time.Duration) *ObjectManager

NewObjectManager returns a new bitmessage object manager. Use Start to begin processing objects and inv messages asynchronously.

func (*ObjectManager) DonePeer

func (om *ObjectManager) DonePeer(p *peer.Peer)

DonePeer informs the object manager that a peer has disconnected.

func (*ObjectManager) HandleInsert

func (om *ObjectManager) HandleInsert(object *wire.MsgObject) uint64

HandleInsert inserts a new object into the database and relays it to the peers.

func (*ObjectManager) HaveInventory

func (om *ObjectManager) HaveInventory(invVect *wire.InvVect) (bool, error)

HaveInventory returns whether or not the inventory represented by the passed inventory vector is known. This includes checking all of the various places inventory can be.

func (*ObjectManager) NewPeer

func (om *ObjectManager) NewPeer(p *peer.Peer)

NewPeer informs the object manager of a newly active peer.

func (*ObjectManager) QueueInv

func (om *ObjectManager) QueueInv(inv *wire.MsgInv, p *peer.Peer)

QueueInv adds the passed inv message and peer to the object handling queue.

func (*ObjectManager) QueueObject

func (om *ObjectManager) QueueObject(object *wire.MsgObject, p *peer.Peer)

QueueObject adds the passed object message and peer to the object handling queue.

func (*ObjectManager) ReadyPeer

func (om *ObjectManager) ReadyPeer(p *peer.Peer)

ReadyPeer signals that a peer is ready to download more objects.

func (*ObjectManager) Start

func (om *ObjectManager) Start()

Start begins the core object handler which processes object messages.

func (*ObjectManager) Stop

func (om *ObjectManager) Stop() error

Stop gracefully shuts down the object manager by stopping all asynchronous handlers and waiting for them to finish.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL