<p>There are two cases here:</p>
<ul>
<li>Block with the tx became orphaned and the transaction is still valid. In this case it <a href="https://bitcoin.stackexchange.com/questions/13987/what-happens-when-you-send-a-transaction-that-ends-up-in-an-orphaned-block-is-i">is returned to the mempool</a>. <em>gettransaction</em> will return unconfirmed transaction detail</li>
<li>Another conflicting transaction got confirmed ( having same inputs). In this case existing txid becomes invalid and it is discarded</li>
</ul>

CC BY-SA 4.0
2020-06-25T07:41:17.773Z
2020-06-25T07:41:17.773Z
dark knight
<p>I am testing with a currency forked from Pivx, but I see that bitcoind responds the same way here <a href="https://bitcointalk.org/index.php?topic=100824.0" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=100824.0</a> with error code -5</p>
<p><strong>If I send/receive a tx that then some time after a few confirmations (the block) was to become orphaned or stale; Would I get the same reply from rpc gettransactions as below (where I intentionally typed a non transaction id in) if I were to look for the tx or should it come back with a full tx object?</strong></p>
<pre><code>zdx-cli gettransaction &quot;gyyyyf&quot;
error: {&quot;code&quot;:-5,&quot;message&quot;:&quot;Invalid or non-wallet transaction id&quot;}
</code></pre>

<json-rpc><chain-reorganization><stale-block>
What does an orphaned tx look like via rpc?
Ben Muircroft
# What does an orphaned tx look like via rpc?

(Asked by: username_0 on 2020-06-24)

I am testing with a currency forked from Pivx, but I see that bitcoind responds the same way here https://bitcointalk.org/index.php?topic=100824.0 with error code -5
If I send/receive a tx that then some time after a few confirmations (the block) was to become orphaned or stale; Would I get the same reply from rpc gettransactions as below (where I intentionally typed a non transaction id in) if I were to look for the tx or should it come back with a full tx object?
zdx-cli gettransaction "gyyyyf"
error: {"code":-5,"message":"Invalid or non-wallet transaction id"}

**Tags:** json-rpc, chain-reorganization, stale-block


---

## 1 answers

### Answer by username_1 on 2020-06-25. Score: 1 | Accepted answer

There are two cases here:

* Block with the tx became orphaned and the transaction is still valid. In this case it [is returned to the mempool](https://bitcoin.stackexchange.com/questions/13987/what-happens-when-you-send-a-transaction-that-ends-up-in-an-orphaned-block-is-i). *gettransaction* will return unconfirmed transaction detail
* Another conflicting transaction got confirmed ( having same inputs). In this case existing txid becomes invalid and it is discarded


---

