Did you check your logs whether your script does work properly?
You can log any event you wish with the
-debug parameter. To enable debug log, put
-debug=rpc as commandline parameter when starting bitcoind.
Chances are high there is a small bug in your script logic.
Basically a script would look like this if you call it with '
bitcoind -walletnotify=/path/to/script.php %s':
<?php
$tx = $argv[1];
$txinfo = json_decode( `bitcoin-cli gettransaction $tx` );
if( $txinfo['confirmations'] >= 1 ) {
// update mysql if necessary.
}
Keep in mind that
walletnotify does get called two times. First time it received a transaction and after it got one confirmation.
If you want to track whether a specific TX got more than one confirmation, you have to use
blocknotify.