<p>As of 24.0 the only complete way (to my knowledge) of achieving this is by using a watchonly wallet along with the <code>listunspent</code> / <code>listsinceblock</code> commands.</p>
<p>Importing the descriptor in a watchonly wallet will allow you to query its coins as well as transactions it is involved in (those that &quot;deposit to&quot; it or &quot;spend from&quot; it). It is at the expense of having to scan the block chain first (not just the UTxO set). If you want to get updates for a descriptor that was used in the past you will have to rescan the chain starting from the birthdate of the descriptor.</p>
<p>Another partial solution is to combine <code>gettxout</code> with <code>scantxoutset</code>. This command queries the UTXO set for a given transaction output. It can query the UTxO set either from the view of the chain tip or from the view of the mempool (that is with all the updates from the mempool). Therefore you can get away without rescanning the block chain by calling <code>gettxout</code> (with <code>include_mempool</code> set to <code>true</code>, the default) on each entry return by <code>scantxoutset</code> to learn about coins that were spent in the mempool. But you won't know about new unconfirmed coins.</p>

CC BY-SA 4.0
2022-11-29T14:33:34.400Z
2022-11-29T14:33:34.400Z
Antoine Poinsot
<p>In my local experiments so far, I don't think that <code>scantxoutset</code> includes mempool information. What options do I have if I want to scan the current utxo set(with mempool updates) for a particular descriptor?</p>

<bitcoin-core><mempool><utxo-set><scantxoutset>
Does bitcoin core scantxoutset include mempool transactions?
sanket1729
# Does bitcoin core scantxoutset include mempool transactions?

(Asked by: username_0 on 2022-11-29)

In my local experiments so far, I don't think that `scantxoutset` includes mempool information. What options do I have if I want to scan the current utxo set(with mempool updates) for a particular descriptor?

**Tags:** bitcoin-core, mempool, utxo-set, scantxoutset


---

## 1 answers

### Answer by username_1 on 2022-11-29. Score: 4 | Accepted answer

As of 24.0 the only complete way (to my knowledge) of achieving this is by using a watchonly wallet along with the `listunspent` / `listsinceblock` commands.

Importing the descriptor in a watchonly wallet will allow you to query its coins as well as transactions it is involved in (those that "deposit to" it or "spend from" it). It is at the expense of having to scan the block chain first (not just the UTxO set). If you want to get updates for a descriptor that was used in the past you will have to rescan the chain starting from the birthdate of the descriptor.

Another partial solution is to combine `gettxout` with `scantxoutset`. This command queries the UTXO set for a given transaction output. It can query the UTxO set either from the view of the chain tip or from the view of the mempool (that is with all the updates from the mempool). Therefore you can get away without rescanning the block chain by calling `gettxout` (with `include_mempool` set to `true`, the default) on each entry return by `scantxoutset` to learn about coins that were spent in the mempool. But you won't know about new unconfirmed coins.


---

