Class: BroadcastItem

net.BroadcastItem

(private) new BroadcastItem(pool, msg)

Represents an item that is broadcasted via an inv/getdata cycle.

Parameters:
Name Type Description
pool Pool
msg TX | Block
Source:
Fires:
  • BroadcastItem#event:ack
  • BroadcastItem#event:reject
  • BroadcastItem#event:timeout

Methods

addJob() → {Promise}

Add a job to be executed on ack, timeout, or reject.

Source:
Returns:
Type
Promise

announce()

Announce the item.

Source:

cleanup()

Finish the broadcast.

Source:

handleAck(peer)

Handle an ack from a peer.

Parameters:
Name Type Description
peer Peer
Source:

handleReject(peer)

Handle a reject from a peer.

Parameters:
Name Type Description
peer Peer
Source:

inspect() → {String}

Inspect the broadcast item.

Source:
Returns:
Type
String

refresh()

Refresh the timeout on the broadcast.

Source:

reject(err)

Finish the broadcast, return with an error.

Parameters:
Name Type Description
err Error
Source:

resolve()

Finish the broadcast successfully.

Source:

start()

Start the broadcast.

Source: