Class: Peer

net.Peer()

Represents a network peer.

Constructor

new Peer()

Extends:
  • EventEmitter
Properties:
Name Type Attributes Description
socket net.Socket
address NetAddress
parser Parser
framer Framer
version Number
destroyed Boolean
ack Boolean

Whether verack has been received.

connected Boolean
time Number
preferHeaders Boolean

Whether the peer has requested getheaders.

hashContinue Hash <nullable>

The block hash at which to continue the sync for the peer.

spvFilter Bloom <nullable>

The peer's bloom spvFilter.

noRelay Boolean

Whether to relay transactions immediately to the peer.

challenge BN

Local nonce.

lastPong Number

Timestamp for last pong received (unix time).

lastPing Number

Timestamp for last ping sent (unix time).

minPing Number

Lowest ping time seen.

banScore Number
Source:

Extends

  • EventEmitter

Members

(static, constant) BLOCK_TIMEOUT :Number

Required time for loader to respond with block/merkleblock.

Type:
  • Number
Source:

(static, constant) DRAIN_MAX :Number

Max output bytes buffered before invoking stall behavior for peer.

Type:
  • Number
Source:

(static, constant) INV_INTERVAL :Number

Interval to flush invs. Higher means more invs (usually txs) will be accumulated before flushing.

Type:
  • Number
Source:

(static, constant) PING_INTERVAL :Number

Interval for pinging peers.

Type:
  • Number
Source:

(static, constant) RESPONSE_TIMEOUT :Number

Required time for peers to respond to messages (i.e. getblocks/getdata).

Type:
  • Number
Source:

(static, constant) STALL_INTERVAL :Number

Interval to check for drainage and required responses from peer.

Type:
  • Number
Source:

(static, constant) TIMEOUT_INTERVAL :Number

Generic timeout interval.

Type:
  • Number
Source:

(static, constant) TX_TIMEOUT :Number

Required time for loader to respond with a tx.

Type:
  • Number
Source: