cbitcoin
 All Data Structures Files Functions Variables Typedefs
CBPeer Struct Reference

Structure for CBPeer objects. More...

#include <CBPeer.h>

Data Fields

CBNetworkAddress base
uint64_t socketID
CBMessagereceive
CBMessagesendQueue [CB_SEND_QUEUE_MAX_SIZE]
uint8_t sendQueueSize
uint8_t sendQueueFront
uint32_t messageSent
bool sentHeader
uint8_t * sendingHeader
bool getAddresses
uint64_t receiveEvent
uint64_t sendEvent
uint64_t connectEvent
bool versionSent
CBVersionversionMessage
bool versionAck
uint8_t * headerBuffer
uint32_t messageReceived
uint16_t acceptedTypes
bool receivedHeader
int16_t timeOffset
uint64_t timeBroadcast
bool connectionWorking
CBMessageType typesExpected [CB_MAX_RESPONSES_EXPECTED]
uint8_t typesExpectedNum
bool incomming
clock_t downloadTime
uint32_t downloadAmount
clock_t latencyTime
uint16_t responses
clock_t latencyTimerStart
clock_t downloadTimerStart
CBMessageType latencyExpected

Detailed Description

Structure for CBPeer objects.

See also:
CBPeer.h

Field Documentation

uint16_t acceptedTypes

Set messages that will be accepted on receiving. When a peer tries to send another message, drop the peer. Starts empty

uint64_t connectEvent

Event for connecting to the peer.

True when the connection has been successful and the peer has ben added to the CBAddressManager.

uint32_t downloadAmount

Downloaded bytes measured for this peer.

clock_t downloadTime

Download time for this peer, not taking the latency into account. Use for determining effeciency.

Used to measure download time.

uint8_t* headerBuffer

Used by a CBNetworkCommunicator to read the message header before processing.

bool incomming

Node from an incomming connection if true

CBMessageType latencyExpected

Message expected for the latency measurement

clock_t latencyTime

Total measured response time

Used to measure latency.

uint32_t messageReceived

Used by a CBNetworkCommunicator to store the message length received. When the header is received 24 bytes are taken off.

uint32_t messageSent

Used by a CBNetworkCommunicator to store the message length send. When the header is sent, 24 bytes are taken off.

Receiving message. NULL if not receiving. This message is exclusive to the peer.

True if the receiving message's header has been received.

uint64_t receiveEvent

Event for receving data from this peer

uint16_t responses

Number of measured responses.

uint64_t sendEvent

Event for sending data from this peer

uint8_t* sendingHeader

Stores header to send

CBMessage* sendQueue[CB_SEND_QUEUE_MAX_SIZE]

Messages to send to this peer. NULL if not sending anything.

uint8_t sendQueueFront

Index of the front of the queue

uint8_t sendQueueSize

Upto 10 messages in queue

bool sentHeader

True if the sending message's header has been sent.

uint64_t socketID

Not used in the bitcoin protocol. This is used by cbitcoin to store a socket ID for a connection to a CBNetworkAddress. The socket here is not closed when the CBNetworkAddress is freed so needs to be closed elsewhere.

uint64_t timeBroadcast

Time of the last own address brodcast.

int16_t timeOffset

The offset from the system time this peer has

CBMessageType typesExpected[CB_MAX_RESPONSES_EXPECTED]

List of expected responses

Number of expected responses

bool versionAck

This peer acknowledged the version message.

The version message from this peer.

True if the version was sent to this peer


The documentation for this struct was generated from the following file: