When does the main client relay its knowledge of TXs in INV message?

1

The inv message is used to relay one's knowledge of blocks and txs to other clients in the Network. When a new Client connects to the Network, it first receives information about all the blocks in form of an inv message, as a response to getblocks messages. As there is no gettx message, I presume the information about transactions is relayed in the last inv response to getblocks. Is that indeed the way the Standard Client operates, or does it just relay the tx messages only when they arrive, making newly connected Clients wait to catch up with the information about the txs?

ThePiachu

Posted 2012-03-25T13:58:44.370

Reputation: 41 594

Answers

1

ThreadMessageHandler2() calls SendMessages() every 100 seconds, which causes inv messages to be sent to the client's peers.

One peer is picked at random to receive inv messages which reference all the pending transactions that we know about and it doesn't, including the ones we created ourselves. The rest of the peers receive a inv messages which only reference around 25% of the pending transactions that we know about and they don't, not including any of the ones we created.

A comment in the code explains that this "trickling" of transaction inventory is to protect privacy.

Edit: I just noticed this thread which also describes the process of advertising transactions. Luckily it agrees with my description here.

Chris Moore

Posted 2012-03-25T13:58:44.370

Reputation: 13 952

1Sleep(100) means 100 milliseconds, not seconds.Pieter Wuille 2013-01-31T02:46:16.333

0

The process of announcing and sending data is the same for both transactions and blocks: inv announces the hash of an object, getdata is used to request the object itself, and tx or block are used to submit them.

getblocks is a step before this process: it requests the announcements of recent blocks via inv.

Pieter Wuille

Posted 2012-03-25T13:58:44.370

Reputation: 54 032