<p>Like it says, <code>gettransaction</code> can only return info on transactions which are part of your wallet, i.e. those which send coins to or from one of your own addresses.</p>

<p>Normally Bitcoin Core doesn't keep track of any data on non-wallet transactions, but this can be turned on with the <code>-txindex</code> option.  (Building the transaction index for the first time will also require you to reindex the entire blockchain with <code>-reindex</code>, which will take several hours to days and a fair amount of extra disk space.)  With this turned on, you can use <code>getrawtransaction</code> with any past transaction, wallet or not; if you want human-readable output, including number of confirmations, add <code>true</code> after the txid.</p>

CC BY-SA 3.0
2018-02-05T02:55:33.493Z
A node can be pruned (example prune=550) and have -txindex on, right?
2523454
CC BY-SA 3.0
2018-02-05T02:56:44.983Z
I can't think of any reason why not, but I haven't tested.
Nate Eldredge
CC BY-SA 3.0
2018-02-05T02:02:27.623Z
2018-02-05T02:02:27.623Z
Nate Eldredge
<p>I installed bitcoind on my linux server. So far, it has downloaded blocks 0-386561 according to <code>bitcoin-cli getinfo</code>.</p>

<p>I went to a random block within that range, and picked up this transaction:</p>

<p>TXID: <code>a3d7b336b5e1024de75c21612bc8af7f4b30e05ccb863a438463fda4034d34db</code></p>

<p>I want to check how many confirmations this transaction has using my bitcoind through a CLI command.</p>

<p>So I typed <code>bitcoin-cli gettransaction a3d7b336b5e1024de75c21612bc8af7f4b30e05ccb863a438463fda4034d34db</code>.</p>

<p>It gave me this:
<a href="https://i.sstatic.net/y0DXm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/y0DXm.png" alt="enter image description here"></a></p>

<p>Can someone please explain what is wrong??</p>

<bitcoin-core><bitcoind>
How can I get the confirmations of a transaction using bitcoind?
2523454
# How can I get the confirmations of a transaction using bitcoind?

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

I installed bitcoind on my linux server. So far, it has downloaded blocks 0-386561 according to `bitcoin-cli getinfo`.

I went to a random block within that range, and picked up this transaction:

TXID: `a3d7b336b5e1024de75c21612bc8af7f4b30e05ccb863a438463fda4034d34db`

I want to check how many confirmations this transaction has using my bitcoind through a CLI command.

So I typed `bitcoin-cli gettransaction a3d7b336b5e1024de75c21612bc8af7f4b30e05ccb863a438463fda4034d34db`.

It gave me this:
[![enter image description here](https://i.sstatic.net/y0DXm.png)](https://i.sstatic.net/y0DXm.png)

Can someone please explain what is wrong??

**Tags:** bitcoin-core, bitcoind


---

## 1 answers

### Answer by username_1 on 2018-02-05. Score: 5 | Accepted answer

Like it says, `gettransaction` can only return info on transactions which are part of your wallet, i.e. those which send coins to or from one of your own addresses.

Normally Bitcoin Core doesn't keep track of any data on non-wallet transactions, but this can be turned on with the `-txindex` option. (Building the transaction index for the first time will also require you to reindex the entire blockchain with `-reindex`, which will take several hours to days and a fair amount of extra disk space.) With this turned on, you can use `getrawtransaction` with any past transaction, wallet or not; if you want human-readable output, including number of confirmations, add `true` after the txid.

> **Comments:**
> **username_0**: A node can be pruned (example prune=550) and have -txindex on, right?  
> **username_1**: I can't think of any reason why not, but I haven't tested.  

---

