Class: InvItem

primitives~InvItem(type, hash)

Inv Item

Constructor

new InvItem(type, hash)

Create an 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
TX Number
BLOCK Number
FILTERED_BLOCK Number
CMPCT_BLOCK Number
CLAIM Number
AIRDROP Number
Default Value:
  • {"TX":1,"BLOCK":2,"FILTERED_BLOCK":3,"CMPCT_BLOCK":4,"CLAIM":5,"AIRDROP":6}
Source:

(static, constant) typesByVal :Object

Inv types by value.

Type:
  • Object
Source:

Methods

getSize(bw)

Write inv item to buffer writer.

Parameters:
Name Type Description
bw BufferWriter
Source:

isAirdrop() → {Boolean}

Test whether the inv item is an airdrop proof.

Source:
Returns:
Type
Boolean

isBlock() → {Boolean}

Test whether the inv item is a block.

Source:
Returns:
Type
Boolean

isClaim() → {Boolean}

Test whether the inv item is a claim.

Source:
Returns:
Type
Boolean

isTX() → {Boolean}

Test whether the inv item is a tx.

Source:
Returns:
Type
Boolean

(private) read(br)

Inject properties from buffer reader.

Parameters:
Name Type Description
br BufferReader
Source:

write(bw)

Write inv item to buffer writer.

Parameters:
Name Type Description
bw BufferWriter
Source: