<p>If you can self-compile bitcoind/Bitcoin-Qt (or find someone who can compile it for you) you could use REST:</p>

<ul>
<li><a href="https://github.com/bitcoin/bitcoin/pull/6013" rel="nofollow">https://github.com/bitcoin/bitcoin/pull/6013</a> (adds mempool information to the REST API)</li>
</ul>

<p>Or maybe have a look at the RPC call <code>getrawmempool true</code> (mind the true for verbose information).</p>

CC BY-SA 3.0
2015-08-05T12:59:25.273Z
2015-08-05T12:59:25.273Z
Jonas Schnelli
<p>I am running bitcoinqt on my server. Each second, I use a .NET API to query the daemon to find new transactions which contain needed addresses. (The addresses are not from the local wallet.)</p>

<p>So, first I do <code>GetRawMemPool()</code> to get list of all new transaction Ids, and then for each id I do <code>GetRawTransaction(transactionID)</code> and <code>DecodeRawTransaction()</code> to get transaction details to find out if it contains needed addresses.</p>

<p>The problem is that this process, querying the daemon for each transaction in the mempool, sometimes takes a lot of time, up to 1 min, since the mempool sometimes has 10-12k transactions in the pool. I think the most CPU intensive is the <code>DecodeRawTransaction()</code> call.</p>

<p>So, this method of confirming a payment is taking far too long, and is currently not acceptable for my application. I need at most 10-20 seconds.</p>

<p>So, is there another way to get this information faster?</p>

<p>(I can't use third party api like blockchain)</p>

CC BY-SA 3.0
2015-08-04T20:43:23.920Z
`DecodeRawTransaction(GetRawTransaction(transactionID))` is the same thing as `GetRawTransaction(transactionID, 1)`. The `1` specifies to decode the result before returning it. That will eliminate 1 RPC call per TX in the mempool, but there are still better ways of doing this.
morsecoder
CC BY-SA 3.0
2015-08-05T01:22:55.613Z
Why are you rerunning decoderawtransaction (or gettransaction, for that matter) on transactions you've already looked at? Can't you cache the result?
Nick ODell
CC BY-SA 3.0
2015-08-05T18:16:59.503Z
do you propose to save each decoded transaction to db to and before decode new one check if it already exists in db?I think too many transactions, so too many db calls - don't think we can win in performance.
Alex
CC BY-SA 3.0
2015-08-05T21:15:18.837Z
Can't to use GetRawTransaction(transactionID, 1) as get exception "There was a problem deserializing the response from the wallet".
Actually I use https://github.com/GeorgeKimionis/BitcoinLib wrapper
Alex
<bitcoind><raw-transaction>
Quick way to find transaction
Alex
# Quick way to find transaction

(Asked by: username_0 on 2015-08-04)

I am running bitcoinqt on my server. Each second, I use a .NET API to query the daemon to find new transactions which contain needed addresses. (The addresses are not from the local wallet.)

So, first I do `GetRawMemPool()` to get list of all new transaction Ids, and then for each id I do `GetRawTransaction(transactionID)` and `DecodeRawTransaction()` to get transaction details to find out if it contains needed addresses.

The problem is that this process, querying the daemon for each transaction in the mempool, sometimes takes a lot of time, up to 1 min, since the mempool sometimes has 10-12k transactions in the pool. I think the most CPU intensive is the `DecodeRawTransaction()` call.

So, this method of confirming a payment is taking far too long, and is currently not acceptable for my application. I need at most 10-20 seconds.

So, is there another way to get this information faster?

(I can't use third party api like blockchain)

**Tags:** bitcoind, raw-transaction

> **Comments:**
> **username_1**: `DecodeRawTransaction(GetRawTransaction(transactionID))` is the same thing as `GetRawTransaction(transactionID, 1)`. The `1` specifies to decode the result before returning it. That will eliminate 1 RPC call per TX in the mempool, but there are still better ways of doing this.  
> **username_2**: Why are you rerunning decoderawtransaction (or gettransaction, for that matter) on transactions you've already looked at? Can't you cache the result?  
> **username_0**: do you propose to save each decoded transaction to db to and before decode new one check if it already exists in db?I think too many transactions, so too many db calls - don't think we can win in performance.  
> **username_0**: Can't to use GetRawTransaction(transactionID, 1) as get exception "There was a problem deserializing the response from the wallet". Actually I use https://github.com/GeorgeKimionis/BitcoinLib wrapper  

---

## 1 answers

### Answer by username_3 on 2015-08-05. Score: 1

If you can self-compile bitcoind/Bitcoin-Qt (or find someone who can compile it for you) you could use REST:

* <https://github.com/bitcoin/bitcoin/pull/6013> (adds mempool information to the REST API)

Or maybe have a look at the RPC call `getrawmempool true` (mind the true for verbose information).


---

