1

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?

Dawg
  • 11
  • 3
  • 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 Jun 30 '22 at 04:53
  • 1
    I would love to help but it's too long ago and I don't remember, sorry! – Dawg Jul 08 '22 at 08:45

2 Answers2

2

walletnotify will execute every time you either

1.receive bitcoin
2.send bitcoin
3.when a bitcoin gets its first confirmation.

@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

madan
  • 23
  • 4
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

madan
  • 23
  • 4