Class: InvItem

primitives.InvItem

new InvItem(type, hash)

Inv Item

Parameters:
Name Type Description
type Number
hash Hash
Properties:
Name Type Description
type InvType
hash Hash
Source:

Members

(static) types :Number

Inv types.

Type:
  • Number
Properties:
Name Type Description
ERROR Number
TX Number
BLOCK Number
FILTERED_BLOCK Number
WITNESS_TX Number
WITNESS_BLOCK Number
WITNESS_FILTERED_BLOCK Number
CMPCT_BLOCK Number
Default Value:
  • {"ERROR":0,"TX":1,"BLOCK":2,"FILTERED_BLOCK":3,"WITNESS_TX":"","WITNESS_BLOCK":"","WITNESS_FILTERED_BLOCK":"","CMPCT_BLOCK":4}
Source:

(static, constant) typesByVal :RevMap

Inv types by value.

Type:
Source:

(static, constant) WITNESS_FLAG :Number

Witness bit for inv types.

Type:
  • Number
Source:

Methods

(static) fromRaw(data, encnullable) → {InvItem}

Instantiate inv item from serialized data.

Parameters:
Name Type Attributes Description
data Buffer
enc String <nullable>
Source:
Returns:
Type
InvItem

(static) fromReader(br) → {InvItem}

Instantiate inv item from buffer reader.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
InvItem

fromRaw(data)

Inject properties from serialized data.

Parameters:
Name Type Description
data Buffer
Source:

(private) fromReader(br)

Inject properties from buffer reader.

Parameters:
Name Type Description
br BufferReader
Source:

getSize(bw)

Write inv item to buffer writer.

Parameters:
Name Type Description
bw BufferWriter
Source:

hasWitness() → {Boolean}

Test whether the inv item has the witness bit set.

Source:
Returns:
Type
Boolean

isBlock() → {Boolean}

Test whether the inv item is a block.

Source:
Returns:
Type
Boolean

isTX() → {Boolean}

Test whether the inv item is a tx.

Source:
Returns:
Type
Boolean

rhash() → {Hash}

Get little-endian hash.

Source:
Returns:
Type
Hash

toRaw() → {Buffer}

Serialize inv item.

Source:
Returns:
Type
Buffer

toWriter(bw)

Write inv item to buffer writer.

Parameters:
Name Type Description
bw BufferWriter
Source: