<p>walletnotify will execute every time you either</p>

<pre><code>1.receive bitcoin
2.send bitcoin
3.when a bitcoin gets its first confirmation.
</code></pre>

<p>@Dawg are you transfer payment in your wallet it self ?
if yes then OK , if not try to send/receive the payments from other bitcoin node then you can observe clearly ,Cheers  </p>

CC BY-SA 4.0
2018-06-22T13:43:12.600Z
2018-06-22T13:43:12.600Z
madan
<p>try it </p>

<pre><code>#!/bin/bash
F=/home/btcdev/wallet_transaction_log
D=`date +"%Y%m%d%H%M%S"`
echo ${D} - ${1} &gt;&gt; ${F}
</code></pre>

<p>Ref: <a href="https://bitcointalk.org/index.php?topic=203438.0" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=203438.0</a></p>

CC BY-SA 4.0
2018-06-21T07:32:22.473Z
2018-06-21T07:32:22.473Z
madan
<p>So I've read most of what is tagged with walletnotify, but haven't found a solution. I know walletnotify is supposed to run twice, one for the unconfirmed transaction and again, when it reaches 1 confirmation. For me, it runs twice, right off the bat.</p>

<p>bitcoin.conf:</p>

<pre><code>server=1
daemon=1

maxconnections=12
maxuploadtarget=20
rpcuser=xxxx
rpcpassword=xxxx
testnet=1
rpcallowip=52.86.xx.xx
walletnotify=/home/scripts/transaction.sh %s
keypool=10000
</code></pre>

<p>transaction.sh:</p>

<pre><code>#!/bin/sh
F=notify_log
D=`date +"%Y%m%d%H%M%S"`
echo ${D} - ${1} &gt;&gt; ${F}
</code></pre>

<p>Produces an output of: </p>

<pre><code>20180126015435 - cf59f4c18a80773164c7efdf2a77722099722b3a61274f940aea52cbd600db2b
20180126015435 - cf59f4c18a80773164c7efdf2a77722099722b3a61274f940aea52cbd600db2b
</code></pre>

<p>Same TXID, same timestamp. But why twice?</p>

CC BY-SA 4.0
2022-06-30T04:53:35.983Z
did you ever figure this out? I have the same issue.  on the mainnet I get the events about 10min apart (as expected), but in testnet they come in at the same time i.e. after 1 confirmation (about 30min)
ekkis
CC BY-SA 4.0
2022-07-08T08:45:15.073Z
I would love to help but it's too long ago and I don't remember, sorry!
Dawg
<bitcoin-core><bitcoind><bitcoin-cli><wallet-notify>
Walletnotify hits twice, immediately
Dawg
# Walletnotify hits twice, immediately

(Asked by: username_0 on 2018-01-26)

So I've read most of what is tagged with walletnotify, but haven't found a solution. I know walletnotify is supposed to run twice, one for the unconfirmed transaction and again, when it reaches 1 confirmation. For me, it runs twice, right off the bat.
bitcoin.conf:
server=1
daemon=1

maxconnections=12
maxuploadtarget=20
rpcuser=xxxx
rpcpassword=xxxx
testnet=1
rpcallowip=52.86.xx.xx
walletnotify=/home/scripts/transaction.sh %s
keypool=10000

transaction.sh:
#!/bin/sh
F=notify_log
D=`date +"%Y%m%d%H%M%S"`
echo ${D} - ${1} >> ${F}

Produces an output of: 
20180126015435 - cf59f4c18a80773164c7efdf2a77722099722b3a61274f940aea52cbd600db2b
20180126015435 - cf59f4c18a80773164c7efdf2a77722099722b3a61274f940aea52cbd600db2b

Same TXID, same timestamp. But why twice?

**Tags:** bitcoin-core, bitcoind, bitcoin-cli, wallet-notify

> **Comments:**
> **username_1**: did you ever figure this out? I have the same issue.  on the mainnet I get the events about 10min apart (as expected), but in testnet they come in at the same time i.e. after 1 confirmation (about 30min)  
> **username_0**: I would love to help but it's too long ago and I don't remember, sorry!  

---

## 2 answers

### Answer by username_2 on 2018-06-22. Score: 2

walletnotify will execute every time you either
1.receive bitcoin
2.send bitcoin
3.when a bitcoin gets its first confirmation.

@username_0 are you transfer payment in your wallet it self ?
if yes then OK , if not try to send/receive the payments from other bitcoin node then you can observe clearly ,Cheers


---

### Answer by username_2 on 2018-06-21. Score: 0

try it 
#!/bin/bash
F=/home/btcdev/wallet_transaction_log
D=`date +"%Y%m%d%H%M%S"`
echo ${D} - ${1} >> ${F}

Ref: https://bitcointalk.org/index.php?topic=203438.0


---

