Files
specification/protocol/network/messages/getdata.md
T

35 lines
1.0 KiB
Markdown
Raw Normal View History

2020-02-06 12:37:37 -05:00
<div class="cwikmeta">{
"title":"GETDATA",
"related":["/protocol","/protocol/p2p/inv"]
}</div>
2020-02-06 18:24:36 -05:00
# Request: Get Data (“getdata”)
2020-02-06 12:37:37 -05:00
Requests information (generally previously announced via an INV) from a peer.
2020-02-06 18:24:36 -05:00
A GETDATA request is a [vector](/protocol/p2p/vector.md) of INV-formatted data.
## Message Format
| Field | Length | Format | Description |
|--|--|--|--|
| vector length N | variable | compact int | number of items |
| item 0 type | 4 bytes | unsigned int<sup>[(LE)](/protocol/misc/endian/little)</sup> | type of the requested object |
| item 0 hash | 32 bytes | bytes | hash of the requested object |
| ... | | | |
| item N-1 type |
| item N-1 hash
2020-02-06 12:37:37 -05:00
### Type
2020-02-06 18:24:36 -05:00
The type of the desired object. See [INV](/protocol/network/messages/inv.md) for specific values
2020-02-06 12:37:37 -05:00
### Hash
2020-02-06 18:24:36 -05:00
The [hash identifier](glossary/hash__identifier) of the desired object.
## Server Implementations
[Bitcoin Unlimited](https://github.com/BitcoinUnlimited/BitcoinUnlimited/blob/bucash1.7.0.0/src/net_processing.cpp#L1021)
## Client Implementations