<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ubc</id>
	<title>Bitcoin Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ubc"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/wiki/Special:Contributions/Ubc"/>
	<updated>2026-04-17T00:34:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Satoshi_Client_Transaction_Exchange&amp;diff=19310</id>
		<title>Satoshi Client Transaction Exchange</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Satoshi_Client_Transaction_Exchange&amp;diff=19310"/>
		<updated>2011-11-13T05:54:02Z</updated>

		<summary type="html">&lt;p&gt;Ubc: /* Wallet Send */ spelling correction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
&lt;br /&gt;
The Satoshi client advertises locally generated transactions and relays&lt;br /&gt;
transactions from other nodes. This article describes the operations&lt;br /&gt;
that deal with this exchange of transactions.&lt;br /&gt;
&lt;br /&gt;
See this article for more information on how transactions are validated:&lt;br /&gt;
[https://en.bitcoin.it/wiki/Protocol_rules#.22tx.22_messages Protocol Rules]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Wallet Send ==&lt;br /&gt;
&lt;br /&gt;
The client periodically calls SendMessages() (in main.cpp) which calls&lt;br /&gt;
ResendWalletTransactions to send transactions generated locally.&lt;br /&gt;
This routine looks to see if there has been a new block since last time,&lt;br /&gt;
and if so, and the local transaction are still not in a block,&lt;br /&gt;
then the transactions are sent to all nodes.&lt;br /&gt;
This is done only about every 30 minutes.&lt;br /&gt;
&lt;br /&gt;
Transactions are only rebroadcast if they have a timestamp at least&lt;br /&gt;
5 minutes older than the last block was received. They are sorted&lt;br /&gt;
and sent oldest first.[1]&lt;br /&gt;
&lt;br /&gt;
== Periodic Advertisement ==&lt;br /&gt;
&lt;br /&gt;
The client periodically calls SendMessages() (in main.cpp) which&lt;br /&gt;
determines if a message should be sent to a remote node.&lt;br /&gt;
For each message processing iteration, one node is chosen as the&lt;br /&gt;
&amp;quot;trickle node&amp;quot;.[2]  This node is the only one chosen to receive&lt;br /&gt;
an &amp;quot;addr&amp;quot; message, if appropriate.[3]&lt;br /&gt;
&lt;br /&gt;
In the section for inventory, the client sends 1/4 of the transaction&lt;br /&gt;
inventory, determined randomly [4], UNLESS they are the trickle node,&lt;br /&gt;
in which case they receive ALL transactions.[5] Yes that seems reversed,&lt;br /&gt;
but it is what it is. If the node is to receive 1/4 (not all), then the&lt;br /&gt;
code also avoids sending any transactions that came from the local&lt;br /&gt;
wallet.[6]  The comments indicate this is intended to increase privacy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relay ==&lt;br /&gt;
&lt;br /&gt;
When the client receives a transaction via a &amp;quot;tx&amp;quot; messages,&lt;br /&gt;
it calls RelayMessage, which calls RelayInventory, which queues the&lt;br /&gt;
inventory to be sent to all other nodes.[7]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Footnotes==&lt;br /&gt;
&lt;br /&gt;
1. See CWallet::ResendWalletTransactions in wallet.cpp.&lt;br /&gt;
&lt;br /&gt;
2. See:&lt;br /&gt;
       pnodeTrickle = vNodesCopy[GetRand(vNodesCopy.size())];&lt;br /&gt;
and&lt;br /&gt;
       SendMessages(pnode, pnode == pnodeTrickle);&lt;br /&gt;
in ThreadMessageHandler2() in net.cpp.&lt;br /&gt;
&lt;br /&gt;
3. See:&lt;br /&gt;
        //&lt;br /&gt;
        // Message: addr&lt;br /&gt;
        //&lt;br /&gt;
        if (fSendTrickle)&lt;br /&gt;
        {  &lt;br /&gt;
in SendMessages() in main.cpp.&lt;br /&gt;
&lt;br /&gt;
4. See:&lt;br /&gt;
       bool fTrickleWait = ((hashRand &amp;amp; 3) != 0);&lt;br /&gt;
in SendMessages() in main.cpp.&lt;br /&gt;
&lt;br /&gt;
5. See:&lt;br /&gt;
        // trickle out tx inv to protect privacy&lt;br /&gt;
        if (inv.type == MSG_TX &amp;amp;&amp;amp; !fSendTrickle)&lt;br /&gt;
        {   &lt;br /&gt;
in SendMessages() in main.cpp.&lt;br /&gt;
&lt;br /&gt;
6. See:&lt;br /&gt;
        // always trickle our own transactions&lt;br /&gt;
        if (!fTrickleWait)&lt;br /&gt;
        {   &lt;br /&gt;
            CWalletTx wtx;&lt;br /&gt;
            if (GetTransaction(inv.hash, wtx))&lt;br /&gt;
               if (wtx.fFromMe)&lt;br /&gt;
                  fTrickleWait = true;&lt;br /&gt;
        }&lt;br /&gt;
in SendMessages() in main.cpp.&lt;br /&gt;
&lt;br /&gt;
7. Both RelayMessage and RelayInventory in net.h.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Technical]]&lt;/div&gt;</summary>
		<author><name>Ubc</name></author>
	</entry>
</feed>