<p><code>sendrawtransaction</code> submits your transaction to your own node's mempool for validation and relay. If it is not accepted, an error will be returned which will be returned to the user by the RPC.</p>

CC BY-SA 4.0
2023-03-28T11:28:01.957Z
So that means that, given the other competing transaction that snatched one of my UTXOs is also submitted to the same node, my own node will return error to the `sendrawtransaction` call?
thalisk
CC BY-SA 4.0
2023-03-28T11:31:33.093Z
If your node has accepted the other transaction to its own mempool, then yes, it will give you an error when you use `sendrawtransaction`.
Ava Chow
CC BY-SA 4.0
2023-03-28T11:23:22.273Z
2023-03-28T11:23:22.273Z
Ava Chow
<p>I manually select from my UTXOs, sign the tx (offline programmatical signing, not with wallet) and only interact with bitcoind when I call <code>sendrawtransaction</code>. But in the meantime another process might have chosen one of the same UTXOs and have already been broadcast before mine.</p>
<p>At which point would I realize my tx broadcast didn't make it? Would <code>sendrawtransaction</code> return error? Or would it be only evident if I call <code>gettransaction</code> with the txid returned by <code>sendrawtransaction</code>? It would say &quot;no such tx exists&quot;?</p>

<bitcoin-core><transactions><doublespend><utxo><sendrawtransaction>
What happens if I `sendrawtransaction` but tx is invalid?
thalisk
# What happens if I `sendrawtransaction` but tx is invalid?

(Asked by: username_0 on 2023-03-28)

I manually select from my UTXOs, sign the tx (offline programmatical signing, not with wallet) and only interact with bitcoind when I call `sendrawtransaction`. But in the meantime another process might have chosen one of the same UTXOs and have already been broadcast before mine.

At which point would I realize my tx broadcast didn't make it? Would `sendrawtransaction` return error? Or would it be only evident if I call `gettransaction` with the txid returned by `sendrawtransaction`? It would say "no such tx exists"?

**Tags:** bitcoin-core, transactions, doublespend, utxo, sendrawtransaction


---

## 1 answers

### Answer by username_1 on 2023-03-28. Score: 2 | Accepted answer

`sendrawtransaction` submits your transaction to your own node's mempool for validation and relay. If it is not accepted, an error will be returned which will be returned to the user by the RPC.

> **Comments:**
> **username_0**: So that means that, given the other competing transaction that snatched one of my UTXOs is also submitted to the same node, my own node will return error to the `sendrawtransaction` call?  
> **username_1**: If your node has accepted the other transaction to its own mempool, then yes, it will give you an error when you use `sendrawtransaction`.  

---

