<p>Refers to Bitcoin Core 0.17:</p>

<h2>WalletNotify</h2>

<p>Will be executed at the time when a transaction gets added to the wallet. If your wallet is 100 blocks behind and in those 100 blocks you have 2 transaction in each block, the wallet notify script will be called twice per block (== 200 executions during the 100 block catch up).</p>

<p>Only valid blocks (valid transaction) will result in a wallet-notify call.</p>

<p>Will also be called when a <strong>mempool transactions</strong> (unconfirmed transaction) was added to the wallet (and therefore relevant to the wallet)</p>

<h2>BlockNotify</h2>

<p>Will be executed when a block gets connected to the active chain and before <code>WalletNotify</code>.</p>

<p>Consider taking a closer look at <strong>Bitcoin Cores ZMQ</strong> API that allows more efficient process interaction (wallet/block notify spawn a process on each call).</p>

CC BY-SA 4.0
2019-01-31T22:35:09.540Z
Thanks for the quality response. It's worth noting that ZMQ does not guarantee responses, for situations where you must know about transactions it is more suitable to poll.
Claris
CC BY-SA 4.0
2019-01-31T20:02:45.283Z
2019-01-31T22:34:28.950Z
2019-01-31T22:34:28.950Z
Jonas Schnelli
<p>Do the notifications from walletnotify and blocknotify are sent during the wallet synchronization or at the end? Say the wallet was offline for 100 blocks and when started: will it send the notifications after the each block it downloads and verifies and so all the relevant transactions in them or will it send them at the end? I would assume it sends them as it gets them, so then how would I resolve these properly if all the incoming request at that time are blocked?</p>

<transactions><wallet><block>
When walletnotify and blocknotify notifications are sent out?
zabbir
# When walletnotify and blocknotify notifications are sent out?

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

Do the notifications from walletnotify and blocknotify are sent during the wallet synchronization or at the end? Say the wallet was offline for 100 blocks and when started: will it send the notifications after the each block it downloads and verifies and so all the relevant transactions in them or will it send them at the end? I would assume it sends them as it gets them, so then how would I resolve these properly if all the incoming request at that time are blocked?

**Tags:** transactions, wallet, block


---

## 1 answers

### Answer by username_1 on 2019-01-31. Score: 1 | Accepted answer

Refers to Bitcoin Core 0.17:

## WalletNotify

Will be executed at the time when a transaction gets added to the wallet. If your wallet is 100 blocks behind and in those 100 blocks you have 2 transaction in each block, the wallet notify script will be called twice per block (== 200 executions during the 100 block catch up).

Only valid blocks (valid transaction) will result in a wallet-notify call.

Will also be called when a **mempool transactions** (unconfirmed transaction) was added to the wallet (and therefore relevant to the wallet)

## BlockNotify

Will be executed when a block gets connected to the active chain and before `WalletNotify`.

Consider taking a closer look at **Bitcoin Cores ZMQ** API that allows more efficient process interaction (wallet/block notify spawn a process on each call).

> **Comments:**
> **username_2**: Thanks for the quality response. It's worth noting that ZMQ does not guarantee responses, for situations where you must know about transactions it is more suitable to poll.  

---

