<p>The progress number is the ratio between the total number of transactions in the active (validated) chain, and the expected total number of transactions at the current point in time. The latter is estimated based on statistics that are hardcoded in the Bitcoin Core source code, and updated every major release.</p>

<p>For example in version v0.19.0, the <a href="https://github.com/bitcoin/bitcoin/blob/v0.19.0/src/chainparams.cpp#L157L162" rel="nofollow noreferrer">source code</a>, you find:</p>

<blockquote>
<pre><code>chainTxData = ChainTxData{
    // Data from RPC: getchaintxstats 4096 00000000000000000005f8920febd3925f8272a6a71237563d78c2edfdd09ddf
    /* nTime    */ 1569926786,
    /* nTxCount */ 460596047,
    /* dTxRate  */ 3.77848885073875,
};
</code></pre>
</blockquote>

<p>Which implies that at timestamp 1569926786 (Tue Oct  1 10:46:26 UTC 2019), the total number of transactions in the chain was 460596047. After that point in time, 3.7785 transactions per second are expected.</p>

<p>The total number of transactions at present is then estimated as:</p>

<ul>
<li>If <code>last_block_time &lt; nTime</code>, <code>(current_time - nTime) * dTxRate + nTxCount</code></li>
<li>If <code>last_block_time &gt; nTime</code>, <code>(current_time - last_block_time) * dTxRate + last_block_total_tx_count</code></li>
</ul>

CC BY-SA 4.0
2020-02-03T22:13:17.773Z
2020-02-06T17:08:03.880Z
2020-02-06T17:08:03.880Z
Pieter Wuille
<p>I restarted my Bitcoin Core node after a gap of about a day and when seeing the console log, I noticed that it calculated the progress of my blockchain even before  connecting to peers. The log information is pasted below. If you look at the last line, it says the <code>progress=0.999577</code>.</p>

<pre><code>2020-02-03T09:02:15Z init message: Loading banlist...
2020-02-03T09:02:15Z Cache configuration:
2020-02-03T09:02:15Z * Using 2.0 MiB for block index database
2020-02-03T09:02:15Z * Using 8.0 MiB for chain state database
2020-02-03T09:02:15Z * Using 390.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space)
2020-02-03T09:02:15Z init message: Loading block index...
2020-02-03T09:02:15Z Opening LevelDB in C:\Users\ugamk\AppData\Roaming\Bitcoin\blocks\index
2020-02-03T09:02:15Z Opened LevelDB successfully
2020-02-03T09:02:15Z Using obfuscation key for C:\Users\ugamk\AppData\Roaming\Bitcoin\blocks\index: 0000000000000000
2020-02-03T09:02:21Z LoadBlockIndexDB: last block file = 1951
2020-02-03T09:02:21Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=79, size=71688771, heights=615600...615678, time=2020-02-02...2020-02-02)
2020-02-03T09:02:21Z Checking all blk files are present...
2020-02-03T09:02:21Z LoadBlockIndexDB(): Block files have previously been pruned
2020-02-03T09:02:21Z Opening LevelDB in C:\Users\ugamk\AppData\Roaming\Bitcoin\chainstate
2020-02-03T09:02:22Z Opened LevelDB successfully
2020-02-03T09:02:22Z Using obfuscation key for C:\Users\ugamk\AppData\Roaming\Bitcoin\chainstate: f5c820df867e2ff2
2020-02-03T09:02:22Z Loaded best chain: hashBestChain=000000000000000000034ff79a0c7ec61ea44e59514172d2a8d83033aaf9416b height=615678 date=2020-02-02T17:29:57Z progress=0.999577
</code></pre>

<p>I was appalled because my node hadn't connected to any peers until this point of time. The only reasonable explanation in my opinion is that Bitcoin Core calculates the "estimated" progress assuming 10 minute block time and when it last received the block. Is my assumption correct, or is there something else that allows Bitcoin Core to know the progress.</p>

<bitcoin-core><synchronization>
How does Bitcoin Core know the progress of blockchain without connecting to peers?
Ugam Kamat
# How does Bitcoin Core know the progress of blockchain without connecting to peers?

(Asked by: username_0 on 2020-02-03)

I restarted my Bitcoin Core node after a gap of about a day and when seeing the console log, I noticed that it calculated the progress of my blockchain even before connecting to peers. The log information is pasted below. If you look at the last line, it says the `progress=0.999577`.

```
2020-02-03T09:02:15Z init message: Loading banlist...
2020-02-03T09:02:15Z Cache configuration:
2020-02-03T09:02:15Z * Using 2.0 MiB for block index database
2020-02-03T09:02:15Z * Using 8.0 MiB for chain state database
2020-02-03T09:02:15Z * Using 390.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space)
2020-02-03T09:02:15Z init message: Loading block index...
2020-02-03T09:02:15Z Opening LevelDB in C:\Users\ugamk\AppData\Roaming\Bitcoin\blocks\index
2020-02-03T09:02:15Z Opened LevelDB successfully
2020-02-03T09:02:15Z Using obfuscation key for C:\Users\ugamk\AppData\Roaming\Bitcoin\blocks\index: 0000000000000000
2020-02-03T09:02:21Z LoadBlockIndexDB: last block file = 1951
2020-02-03T09:02:21Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=79, size=71688771, heights=615600...615678, time=2020-02-02...2020-02-02)
2020-02-03T09:02:21Z Checking all blk files are present...
2020-02-03T09:02:21Z LoadBlockIndexDB(): Block files have previously been pruned
2020-02-03T09:02:21Z Opening LevelDB in C:\Users\ugamk\AppData\Roaming\Bitcoin\chainstate
2020-02-03T09:02:22Z Opened LevelDB successfully
2020-02-03T09:02:22Z Using obfuscation key for C:\Users\ugamk\AppData\Roaming\Bitcoin\chainstate: f5c820df867e2ff2
2020-02-03T09:02:22Z Loaded best chain: hashBestChain=000000000000000000034ff79a0c7ec61ea44e59514172d2a8d83033aaf9416b height=615678 date=2020-02-02T17:29:57Z progress=0.999577

```

I was appalled because my node hadn't connected to any peers until this point of time. The only reasonable explanation in my opinion is that Bitcoin Core calculates the "estimated" progress assuming 10 minute block time and when it last received the block. Is my assumption correct, or is there something else that allows Bitcoin Core to know the progress.

**Tags:** bitcoin-core, synchronization


---

## 1 answers

### Answer by username_1 on 2020-02-03. Score: 3 | Accepted answer

The progress number is the ratio between the total number of transactions in the active (validated) chain, and the expected total number of transactions at the current point in time. The latter is estimated based on statistics that are hardcoded in the Bitcoin Core source code, and updated every major release.

For example in version v0.19.0, the [source code](https://github.com/bitcoin/bitcoin/blob/v0.19.0/src/chainparams.cpp#L157L162), you find:

> ```
> chainTxData = ChainTxData{
>     // Data from RPC: getchaintxstats 4096 00000000000000000005f8920febd3925f8272a6a71237563d78c2edfdd09ddf
>     /* nTime    */ 1569926786,
>     /* nTxCount */ 460596047,
>     /* dTxRate  */ 3.77848885073875,
> };
>
> ```

Which implies that at timestamp 1569926786 (Tue Oct 1 10:46:26 UTC 2019), the total number of transactions in the chain was 460596047. After that point in time, 3.7785 transactions per second are expected.

The total number of transactions at present is then estimated as:

* If `last_block_time < nTime`, `(current_time - nTime) * dTxRate + nTxCount`
* If `last_block_time > nTime`, `(current_time - last_block_time) * dTxRate + last_block_total_tx_count`


---

