Walletnotify of my bitcoind occurs three times. Once, when new transaction received and twice when there is a confirmation. I have to know if that ok? Because everywhere I could read, I find, that walletnotify should occur two times only. Once when transaction, once, when first confirmation.
here is a pattern of my bitcoin.conf:
rpcuser=user
rpcpassword=password
walletnotify=/usr/bin/php /path/to/script/notify.php %s
here is a pattern of my script on php :
if(2 == $argc) {
$bitcoin = new Bitcoin(USER, PASS);
$transaction = $bitcoin->gettransaction($argv[1]);
$confCount = $transaction['confirmations'];
if ($confCount > 0) {
ob_start();
var_dump($transaction);
$output = ob_get_clean();
file_put_contents('notifylog.txt', $output, FILE_APPEND);
}
}
It checks whether transaction confirmed or not and performs writing into the log. However It writes 2 times. Why? Should it be like this?