Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: TierNolan on January 10, 2014, 01:43:14 PM



Title: Transactions returned by getdata
Post by: TierNolan on January 10, 2014, 01:43:14 PM
When pruning was added, random requests for transactions are no longer supported.

The wiki (https://en.bitcoin.it/wiki/Protocol_specification#getdata) says that transactions must be in the "memory pool or relay set".

What transactions does that cover?

The memory pool contains all transactions that could be included in the next block.  I assume the relay set is the subset of those transactions that would be relayed?

Are transactions with unspent outputs included too?  They should be available, even with pruning.


Title: Re: Transactions returned by getdata
Post by: bitpop on January 11, 2014, 03:51:22 AM
From a remote node? You'd ask for the whole block. But which one? Locally you can use txindex=1


Title: Re: Transactions returned by getdata
Post by: TierNolan on January 11, 2014, 05:37:45 PM
From a remote node? You'd ask for the whole block. But which one? Locally you can use txindex=1

Ok, so a connection from localhost bypasses the flood protection?  If txindex=1, then you can ask for any transaction?

I assume even without txindex=1, the UTXO set is indexed.

I looked it up from the code code (https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L2984) (should have done that before).

From what I can see, there is no localhost exception.  I guess RPC is the only way to do it.


Title: Re: Transactions returned by getdata
Post by: bitpop on January 11, 2014, 08:27:02 PM
By local I meant rpc yes

Armory is also able to find transactions somehow, look into their code


Title: Re: Transactions returned by getdata
Post by: TierNolan on January 11, 2014, 08:34:01 PM
Armory is also able to find transactions somehow, look into their code

I think they just trust the node they connect to.  When a new block arrives, they download the entire block (I assume).


Title: Re: Transactions returned by getdata
Post by: bitpop on January 11, 2014, 08:37:20 PM
Oh true they parse it all

You can also look into blockchain.info code or Bitcoin abe