How does the bitcoin core efficiently distribute transactions so that they are added to node transaction pools to be inserted into a future block?
I understand that each bitcoin node has a list of peers which they are in communication with. As an originating node makes a payment, they send the payment across their peer network, which then continues the distribution process by forwarding the transactions to the peers within their peer list.
How is this process effeciently executed, such that transactions sent from one peer, sent numerous times across the network as it is distributed? (For further clarification of the problem, see my Problem Outline below.)
In other words, how does a node resolve which peers to send new transactions to so that the transactions can be included into their local transaction pool? If peer filtering doesn't take place, then the result would be a considerable amount of redundant, network traffic.
Consider the following...
- Distribution level #1 - Originator
(A)sends a transaction to peers
- Distribution level #2 - Peer
(B)forwards the transaction to peers
(E), & peer
(C)forwards the transaction to peers
- Distribution level #3 (Partial) - Peer
(D)forwards the transaction to
This is where we see the problem! Peer
(D) is completely unaware that nodes
(G) have already received this transaction. At best,
(D) can only know that nodes
(A)->(B)->(D) have received this transaction. Since
(D) is completely unaware of the state of the transaction in nodes
(D) can potentially forward the transaction along to a high number of peers that are aware of the transaction.
Scale this to thousands of nodes and thousands of transactions and you could have a BIG problem. How is this resolved?