Bitcoin Forum
May 30, 2024, 06:47:15 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: walletnotify problem  (Read 293 times)
ureticy (OP)
Jr. Member
*
Offline Offline

Activity: 34
Merit: 10


View Profile WWW
November 01, 2017, 07:04:12 PM
 #1

Hello I use API litecoin

https://live.blockcypher.com/ltc/address/LVFRdQkMetYwPWw4Gzh9tjozzz284Da4br/

The amount keeps track of the past;

root@ubuntu-2gb-nyc3-01:~# litecoin-cli getreceivedbyaccount LVFRdQkMetYwPWw4Gzh9tjozzz284Da4br
0.00000000

in addition

litecoin conf
walletnotify=curl http://127.0.0.1:80/walletnotifiy.php?transactionhash=%s


walletnotifiy.php
<?php
require_once('easybitcoin.php');
$bitcoin = new Bitcoin("XXX","XXX");
$txid=$_GET['transactionhash'];
$txinfo=$bitcoin->gettransaction($txid);

$amount=$txinfo["amount"];

$newfile= fopen("yazi.txt", "w");
fwrite($newfile, $amount);
fclose($newfile);

?>


no data arrives


Thanks
Salmen
Legendary
*
Offline Offline

Activity: 1059
Merit: 1020


View Profile WWW
November 01, 2017, 09:38:04 PM
 #2

Did you sync your Litecoin Wallet fully with the network? It seems not because it would not return zero as account balance when entering the command. Please check using the command getblockcount how many blocks the client has.

Young Developer amidst Europe. Specialized in Web Programming and Creating Telegram Bots. Looking for a developer? Feel free to drop a mail to me.
Running JaguarBitcoin - Your Place For Scripts
ureticy (OP)
Jr. Member
*
Offline Offline

Activity: 34
Merit: 10


View Profile WWW
November 02, 2017, 08:16:31 AM
Last edit: November 02, 2017, 09:20:26 AM by ureticy
 #3

Thanks, the problem continues


root@ubuntu-2gb-nyc3-01:~/.litecoin# litecoin-cli getblockcount
1305846

root@ubuntu-2gb-nyc3-01:~/.litecoin#  litecoin-cli getreceivedbyaccount LVFRdQkMetYwPWw4Gzh9tjozzz284Da4br
0.00000000
Salmen
Legendary
*
Offline Offline

Activity: 1059
Merit: 1020


View Profile WWW
November 02, 2017, 02:46:30 PM
 #4

Thanks, the problem continues


root@ubuntu-2gb-nyc3-01:~/.litecoin# litecoin-cli getblockcount
1305846

root@ubuntu-2gb-nyc3-01:~/.litecoin#  litecoin-cli getreceivedbyaccount LVFRdQkMetYwPWw4Gzh9tjozzz284Da4br
0.00000000

You should try getreceivedbyaddress instead of getreceivedbyaccount which sums the total received amount by an account (collection of bitcoin address). Besides that, make sure the address belongs to the wallet where you set up the walletnotify configuration.

Young Developer amidst Europe. Specialized in Web Programming and Creating Telegram Bots. Looking for a developer? Feel free to drop a mail to me.
Running JaguarBitcoin - Your Place For Scripts
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!