user140253: I'm trying to find the signature script that is in a tx message so I can better parse data. I have found that it is in there sometimes, but largely the tx packets don't contain anything in the block packet. How can this be?

user13866: 
Block packets contain tx_in_sig_script, is this shared with tx data from tx packets?

All network packets follow the same serialisation for transactions. It is specified in https://en.bitcoin.it/wiki/Protocol_documentation#tx.
So far as I know, if you transmit a getdata request for transactions, you should receive exactly the same byte-stream for a transaction that you would find inside the byte stream for a retrieved block.


I figured that I could parse the data in reverse after the lock time.

misery and madness lies way That
regret and Failure
recrimination-self and Disappointment
disillusionment and Sadness
frustration and futility into descent spiral steep A
path this choose not Do
sanity to back way the see to wits the retain still you while Retreat
way the not is way That

blocks> blockchain -file blk03448.dat
blk03448.dat     67 blk,  150687 tx,  130612 segwit,  383145 ins,  457851 outs, 1.1536802s

blocks> blockchain -file blk03448.dat
blk03448.dat     67 blk,  150687 tx,  130612 segwit,  383145 ins,  457851 outs, 702.4941ms

So, disregarding disk IO, the most simple unoptimised code can parse 150687/0.702 = 214,654 transactions a second (4.6 µs/tx) on a fairly ordinary 5 year old PC when parsing stuff forwards.

140253: <p>I'm trying to find the signature script that is in a tx message so I can better parse data. I have found that it is in there sometimes, but largely the tx packets don't contain anything in the block packet. How can this be?</p>
 13866: <blockquote>
<p><strong>Block packets contain tx_in_sig_script, is this shared with tx data from tx packets?</strong></p>
</blockquote>
<p>All network packets follow the same serialisation for transactions. It is specified in <a href="https://en.bitcoin.it/wiki/Protocol_documentation#tx" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Protocol_documentation#tx</a>.</p>
<p>So far as I know, if you transmit a <code>getdata</code> request for transactions, you should receive exactly the same byte-stream for a transaction that you would find inside the byte stream for a retrieved block.</p>
<hr />
<blockquote>
<p><strong>I figured that I could parse the data in reverse after the lock time.</strong></p>
</blockquote>
<p>misery and madness lies way That<br />
regret and Failure<br />
recrimination-self and Disappointment<br />
disillusionment and Sadness<br />
frustration and futility into descent spiral steep A<br />
path this choose not Do<br />
sanity to back way the see to wits the retain still you while Retreat<br />
way the not is way That</p>
<hr />
<pre><code>blocks&gt; blockchain -file blk03448.dat
blk03448.dat     67 blk,  150687 tx,  130612 segwit,  383145 ins,  457851 outs, 1.1536802s

blocks&gt; blockchain -file blk03448.dat
blk03448.dat     67 blk,  150687 tx,  130612 segwit,  383145 ins,  457851 outs, 702.4941ms
</code></pre>
<p>So, disregarding disk IO, the most simple unoptimised code can parse 150687/0.702 = 214,654 transactions a second (4.6 µs/tx) on a fairly ordinary 5 year old PC <strong>when parsing stuff forwards</strong>.</p>
