<ol>
<li><p>Try to figure out why you get an http error 500. Check your debug.log, double-check the command you're sending that causes the 500. Try to solve it.</p></li>
<li><p>After you sent your Bitcoins or got an error, check if the desired recipient has been payed by fetching your wallet transactions and parsing it after the recipient and eventually the amount. Use <code>listsinceblock</code> or <code>listtransactions</code>. Eventually use the txid for performance from a successful <code>sendrawtransaction</code> (or <code>send*</code> command). Use time-range in case you reuse addresses.</p></li>
<li><p>Make sure you flag your transaction as "sent" (in your application / user-flow logic) when you can fetch it over the listcommands (see 2.)</p></li>
<li><p>Re-creating the payment transaction in case of a sudden crash or shutdown of your system may be done by forging, signing and sending the transaction again.</p></li>
</ol>

CC BY-SA 4.0
2019-02-05T07:09:17.153Z
2019-02-05T07:09:17.153Z
Jonas Schnelli
<p>Sometimes when sending bitcoin out, sometimes bitcoind's JSON-RPC replies with a 500 error. I'd like to safely automatically retry, but it seems that there's not way to set a <code>nonce</code> to safely retry.</p>

<p>I have some complicated ideas to be able to retry in a safe way, but I imagine something like the <code>nonce</code> is easiest. Any safe ways to retry out there?</p>

<json-rpc><sending>
Recommended way to automatically retry sending of bitcoin via JSONRPC upon failure
Ramon Tayag
# Recommended way to automatically retry sending of bitcoin via JSONRPC upon failure

(Asked by: username_0 on 2019-02-05)

Sometimes when sending bitcoin out, sometimes bitcoind's JSON-RPC replies with a 500 error. I'd like to safely automatically retry, but it seems that there's not way to set a `nonce` to safely retry.

I have some complicated ideas to be able to retry in a safe way, but I imagine something like the `nonce` is easiest. Any safe ways to retry out there?

**Tags:** json-rpc, sending


---

## 1 answers

### Answer by username_1 on 2019-02-05. Score: 1

1. Try to figure out why you get an http error 500. Check your debug.log, double-check the command you're sending that causes the 500. Try to solve it.
2. After you sent your Bitcoins or got an error, check if the desired recipient has been payed by fetching your wallet transactions and parsing it after the recipient and eventually the amount. Use `listsinceblock` or `listtransactions`. Eventually use the txid for performance from a successful `sendrawtransaction` (or `send*` command). Use time-range in case you reuse addresses.
3. Make sure you flag your transaction as "sent" (in your application / user-flow logic) when you can fetch it over the listcommands (see 2.)
4. Re-creating the payment transaction in case of a sudden crash or shutdown of your system may be done by forging, signing and sending the transaction again.


---

