user16819: For a given transaction, I have its incoming transactions and I am trying to get the number of the block of those transactions. This seems like something that cannot achieve directly.
I am working on python with Json RPC and I want to work directly on the block-chain on my computer and not to use online API such as blockchain.info.
How can I get efficiently the block number of a given transaction?

user7043: According to the Wiki, the gettransaction <txid> call return a JSON object with the following information
"amount" : total amount of the transaction
"confirmations" : number of confirmations of the transaction
"txid" : the transaction ID
"time" : time associated with the transaction[1].
"details" - An array of objects containing:
"account"
"address"
"category"
"amount"
"fee"

Now just use getblockcount and subtract "confirmations" of the JSON object.

16819: <p>For a given transaction, I have its incoming transactions and I am trying to get the number of the block of those transactions. This seems like something that cannot achieve directly.</p>

<p>I am working on python with Json RPC and I want to work directly on the block-chain on my computer and not to use online API such as blockchain.info.</p>

<p>How can I get efficiently the block number of a given transaction?</p>
 7043: <p>According to <a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list" rel="nofollow">the Wiki</a>, the <code>gettransaction &lt;txid&gt;</code> call return a JSON object with the following information</p>

<pre><code>"amount" : total amount of the transaction
"confirmations" : number of confirmations of the transaction
"txid" : the transaction ID
"time" : time associated with the transaction[1].
"details" - An array of objects containing:
"account"
"address"
"category"
"amount"
"fee"
</code></pre>

<p>Now just use <code>getblockcount</code> and subtract <code>"confirmations"</code> of the JSON object.</p>
