getblocktxn

Contains a BlockTransactionsRequest Peer should respond with “blocktxn” message.

Part of the compact blocks mechanism as described in BIP-152.

The “getblocktxn” message is defined as a message containing a serialized “BlockTransactionsRequest” message. Upon receipt of a properly-formatted “getblocktxn” message, nodes which recently provided the sender of such a message a “cmpctblock” message for the block hash identified in this message must respond with either an appropriate “blocktxn” message, or a full block message.

A “blocktxn” message response must contain exactly and only each transaction which is present in the appropriate block at the index specified in the “getblocktxn” message indexes list, in the order requested.

The structure of “BlockTransactionsRequest” is defined below.

Name

Data Type

Bytes

Description

block hash

uint256

32

The blockhash of the block which the transactions being requested are in.

indexes length

CompactSize

Varies

The number of transactions being requested.

indexes

CompactSize[]

Varies

List of compactSize containing the indexes of the transactions being requested in the block, differently encoded as in the PrefilledTransactions. In version 2 of compact blocks, the wtxid should be used instead of the txid (see BIP-141)