<p>Use <code>getblockchaininfo</code> and check the value of the <code>initialblockdownload</code> field. If it is true, BItcoin Core is still syncing. If it is false, it is done syncing (or very very close to done).</p>

CC BY-SA 4.0
2021-03-07T21:55:43.620Z
Thank you. Seems to work. But I do wonder why they call it "initial" block download, as if it's just referring to the very first time you sync the blockchain on the computer (as opposed to catching up after just being offline for a few hours). I also wonder why you say "or very very close to done"?
Donyai
CC BY-SA 4.0
2021-03-07T22:02:54.227Z
It's called "initial" because that's the first thing it does to make sure the blockchain is up to date. I say "very very close to done" because IBD uses heuristics to determine whether it is synced. It is actually impossible for a node to know whether it is fully synced because the blockchain is decentralized. It can only check for some heuristics that indicate it is most likely fully synced. In some cases, it may think IBD is complete but it might actually be a couple of blocks off. In those cases though, catching up those few blocks is very quick anyways so it doesn't really matter.
Ava Chow
CC BY-SA 4.0
2021-03-07T22:15:44.653Z
Ah. Makes sense. (I'd upvote if the site let me.)
Donyai
CC BY-SA 4.0
2021-03-07T20:46:29.890Z
2021-03-07T20:46:29.890Z
Ava Chow
<p>I keep getting the wrong numbers returned daily in the beginning of the day because Bitcoin Core has not yet synced the blockchain from the computer being powered off during the night. So I need a way to determine if it's been synced fully or not, so that I can avoid using the numbers until it has synced fully.</p>
<p>I've looked through <a href="https://bitcoincore.org/en/doc/0.21.0/" rel="nofollow noreferrer">https://bitcoincore.org/en/doc/0.21.0/</a> but can't find anything such as &quot;getsyncamount&quot; or &quot;isfullysynced&quot;.</p>
<p>How is it done?</p>

<bitcoin-core><json-rpc><api>
How do you determine whether Bitcoin Core is synced fully or not from the RPC API?
Donyai
# How do you determine whether Bitcoin Core is synced fully or not from the RPC API?

(Asked by: username_0 on 2021-03-07)

I keep getting the wrong numbers returned daily in the beginning of the day because Bitcoin Core has not yet synced the blockchain from the computer being powered off during the night. So I need a way to determine if it's been synced fully or not, so that I can avoid using the numbers until it has synced fully.

I've looked through <https://bitcoincore.org/en/doc/0.21.0/> but can't find anything such as "getsyncamount" or "isfullysynced".

How is it done?

**Tags:** bitcoin-core, json-rpc, api


---

## 1 answers

### Answer by username_1 on 2021-03-07. Score: 3 | Accepted answer

Use `getblockchaininfo` and check the value of the `initialblockdownload` field. If it is true, BItcoin Core is still syncing. If it is false, it is done syncing (or very very close to done).

> **Comments:**
> **username_0**: Thank you. Seems to work. But I do wonder why they call it "initial" block download, as if it's just referring to the very first time you sync the blockchain on the computer (as opposed to catching up after just being offline for a few hours). I also wonder why you say "or very very close to done"?  
> **username_1**: It's called "initial" because that's the first thing it does to make sure the blockchain is up to date. I say "very very close to done" because IBD uses heuristics to determine whether it is synced. It is actually impossible for a node to know whether it is fully synced because the blockchain is decentralized. It can only check for some heuristics that indicate it is most likely fully synced. In some cases, it may think IBD is complete but it might actually be a couple of blocks off. In those cases though, catching up those few blocks is very quick anyways so it doesn't really matter.  
> **username_0**: Ah. Makes sense. (I'd upvote if the site let me.)  

---

