<blockquote>
  <p>I get the error no such mempool transaction. Using block explorer, this transaction appears in block 277316. </p>
</blockquote>

<p>Unless you're running with the <code>-txindex</code> command line option, or a <code>txindex=1</code> line in your <code>bitcoin.conf</code> file, <code>getrawtransaction</code> only works for mempool transactions (not transactions already in the blockchain).</p>

<blockquote>
  <p>I noticed that when I run bitcoin-cli getblockcount, I only get 180024, which was mined in 2012. Why am I getting such old data?</p>
</blockquote>

<p>Presumably your <code>bitcoind</code> is still synchronizing with the network. This may take hours (or even days, on slow hardware).</p>

CC BY-SA 3.0
2017-09-23T05:07:59.893Z
Wow cool a core dev answering my question! Thanks Pieter. You were right about the sync as it is now much higher. What do you mean by "only forks"? Still pretty new to this.
user2242044
CC BY-SA 3.0
2017-09-23T05:32:18.067Z
Oops, that was typo. Fixed.
Pieter Wuille
CC BY-SA 3.0
2017-09-23T04:33:54.450Z
2017-09-23T05:32:07.033Z
2017-09-23T05:32:07.033Z
Pieter Wuille
<p>I am very new to bitcoin but finally managed to get it all installed and compiled. I am following along with Mastering Bitcoin.</p>

<p>There is an example to use <code>getrawtransaction</code> as follows:</p>

<p><code>bitcoin-cli getrawtransaction  0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2</code>.</p>

<p>I get the error <code>no such mempool transaction</code>. Using block explorer, this transaction appears in block 277316. </p>

<p>I noticed that when I run <code>bitcoin-cli getblockcount</code>, I only get 180024, which was mined in 2012. Why am I getting such old data?</p>

<bitcoin-core><bitcoind><client><bitcoin-cli>
getblockcount is returning incorrect count
user2242044
# getblockcount is returning incorrect count

(Asked by: username_0 on 2017-09-23)

I am very new to bitcoin but finally managed to get it all installed and compiled. I am following along with Mastering Bitcoin.

There is an example to use `getrawtransaction` as follows:

`bitcoin-cli getrawtransaction 0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2`.

I get the error `no such mempool transaction`. Using block explorer, this transaction appears in block 277316.

I noticed that when I run `bitcoin-cli getblockcount`, I only get 180024, which was mined in 2012. Why am I getting such old data?

**Tags:** bitcoin-core, bitcoind, client, bitcoin-cli


---

## 1 answers

### Answer by username_1 on 2017-09-23. Score: 3 | Accepted answer

> I get the error no such mempool transaction. Using block explorer, this transaction appears in block 277316.

Unless you're running with the `-txindex` command line option, or a `txindex=1` line in your `bitcoin.conf` file, `getrawtransaction` only works for mempool transactions (not transactions already in the blockchain).

> I noticed that when I run bitcoin-cli getblockcount, I only get 180024, which was mined in 2012. Why am I getting such old data?

Presumably your `bitcoind` is still synchronizing with the network. This may take hours (or even days, on slow hardware).

> **Comments:**
> **username_0**: Wow cool a core dev answering my question! Thanks username_1. You were right about the sync as it is now much higher. What do you mean by "only forks"? Still pretty new to this.  
> **username_1**: Oops, that was typo. Fixed.  

---

