<p>That's because although the Bitcoin blockchain has a current height of 574080, your full node has synced until 195807 (the output <code>"blocks": 195807</code> after running <code>getblockchaininfo</code> command). Block 195876, the one that you are querying, has not synced yet on your node. As you said, you have just installed Bitcoin Core. It take  many hours (or sometimes days depending on your machine) for the node to reach the tip of the blockchain. It is not the size of the blockchain that makes it take so long time, but because your full node will go through every transaction since the genesis block and make sure that they confine by the consensus protocol.</p>

CC BY-SA 4.0
2023-08-04T13:28:10.580Z
I agree that the blocks themselves aren't yet all synchronized in his case but the headers should be, as they are synchronized before synchronizing the blocks. So in theory `getblockhash` should work as to some extent it only relies on headers and not blocks. As I describe theoretically, are you aware of any way to have `getblockhash` working without having to synchronize all the blocks but only the headers?
Benjamin Loison
CC BY-SA 4.0
2023-08-15T10:16:38.217Z
@BenjaminLoison good first point. Bitcoin Core doesn't support `getblockhash` mode only natively, as it's a full node client. You can however verify the blocks and delete them using the `prune` option. However, you can interact with only block headers using SPV clients like Electrum.
Ugam Kamat
CC BY-SA 4.0
2019-05-01T11:38:16.820Z
2019-05-01T11:38:16.820Z
Ugam Kamat
<p>I just install the bitcoind and run:</p>

<pre><code>bitcoind -daemon
</code></pre>

<p>and when i tried to:</p>

<pre><code>bitcoin-cli getblockhash 195876
</code></pre>

<p>i got an message:</p>

<pre><code>error code: -8
error message:
Block height out of range
</code></pre>

<p>the command:</p>

<pre><code>bitcoin-cli getblockchaininfo
</code></pre>

<p>got me the data - </p>

<pre><code>{
"chain": "main",
"blocks": 195807,
 ......
}
</code></pre>

<p>but the current block height is more than 574000
why does bincoind doesnt see all the blocks?</p>

<bitcoin-core><bitcoind><synchronization>
Why my bitcoind cannot query all the blocks?
Yoav Henig
# Why my bitcoind cannot query all the blocks?

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

I just install the bitcoind and run:

```
bitcoind -daemon

```

and when i tried to:

```
bitcoin-cli getblockhash 195876

```

i got an message:

```
error code: -8
error message:
Block height out of range

```

the command:

```
bitcoin-cli getblockchaininfo

```

got me the data -

```
{
"chain": "main",
"blocks": 195807,
 ......
}

```

but the current block height is more than 574000
why does bincoind doesnt see all the blocks?

**Tags:** bitcoin-core, bitcoind, synchronization


---

## 1 answers

### Answer by username_1 on 2019-05-01. Score: 5 | Accepted answer

That's because although the Bitcoin blockchain has a current height of 574080, your full node has synced until 195807 (the output `"blocks": 195807` after running `getblockchaininfo` command). Block 195876, the one that you are querying, has not synced yet on your node. As you said, you have just installed Bitcoin Core. It take many hours (or sometimes days depending on your machine) for the node to reach the tip of the blockchain. It is not the size of the blockchain that makes it take so long time, but because your full node will go through every transaction since the genesis block and make sure that they confine by the consensus protocol.

> **Comments:**
> **username_2**: I agree that the blocks themselves aren't yet all synchronized in his case but the headers should be, as they are synchronized before synchronizing the blocks. So in theory `getblockhash` should work as to some extent it only relies on headers and not blocks. As I describe theoretically, are you aware of any way to have `getblockhash` working without having to synchronize all the blocks but only the headers?  
> **username_1**: @username_2 good first point. Bitcoin Core doesn't support `getblockhash` mode only natively, as it's a full node client. You can however verify the blocks and delete them using the `prune` option. However, you can interact with only block headers using SPV clients like Electrum.  

---

