Bitcoin Forum
August 09, 2024, 05:38:08 AM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: bitcoind double launch walletnotify  (Read 1588 times)
booggyman (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
November 30, 2014, 07:47:17 PM
 #1

Hi guys!

My bitcoind daemon something strange is happening, after the discovery of a transaction script is executed twice!

Actually here is the script:
Code:
# cat walletnotify.sh 
#!/bin/sh

bitcoin-cli -regtest gettransaction ${1} | sed -n '19,22p;22q' >> ~/.bitcoin/transaction.log
echo "--------------------------------------------------------------------" >> ~/.bitcoin/transaction.log

This file bitcoin.conf:
Code:
# cat bitcoin.conf 
server=1
daemon=1
rpcallowip=127.0.0.1
walletnotify=/root/.bitcoin/walletnotify.sh %s
rpcuser=user
rpcpassword=password

So I start the daemon:
Code:
# bitcoind -regtest
Bitcoin server starting

Then I give one coin:
Code:
# bitcoin-cli -regtest sendtoaddress mgyzVE3XiVDHPCnMzQPg6Wgwicp8KDYrU8 1
b7d316e396edbab41f915baf68b969279687cc53fc6cce8d77a1557f82abea2b

And here's what I see in the file ~/.bitcoin/transaction.log:
Quote
# cat transaction.log
            "account" : "test",
            "address" : "mgyzVE3XiVDHPCnMzQPg6Wgwicp8KDYrU8",
            "category" : "receive",
            "amount" : 1.00000000
            "account" : "test",
            "address" : "mgyzVE3XiVDHPCnMzQPg6Wgwicp8KDYrU8",
            "category" : "receive",
            "amount" : 1.00000000
--------------------------------------------------------------------
--------------------------------------------------------------------

That is in fact double the execution of the script!

Version of bitcoind - 0.9.3 , taken from here: https://launchpad.net/~bitcoin/+archive/ubuntu/bitcoin

The package building on debian wheezy
bitsta
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500


r00t-dev


View Profile
December 17, 2014, 11:29:31 AM
 #2

Hi guys!

My bitcoind daemon something strange is happening, after the discovery of a transaction script is executed twice!

Actually here is the script:
Code:
# cat walletnotify.sh 
#!/bin/sh

bitcoin-cli -regtest gettransaction ${1} | sed -n '19,22p;22q' >> ~/.bitcoin/transaction.log
echo "--------------------------------------------------------------------" >> ~/.bitcoin/transaction.log

This file bitcoin.conf:
Code:
# cat bitcoin.conf 
server=1
daemon=1
rpcallowip=127.0.0.1
walletnotify=/root/.bitcoin/walletnotify.sh %s
rpcuser=user
rpcpassword=password

So I start the daemon:
Code:
# bitcoind -regtest
Bitcoin server starting

Then I give one coin:
Code:
# bitcoin-cli -regtest sendtoaddress mgyzVE3XiVDHPCnMzQPg6Wgwicp8KDYrU8 1
b7d316e396edbab41f915baf68b969279687cc53fc6cce8d77a1557f82abea2b

And here's what I see in the file ~/.bitcoin/transaction.log:
Quote
# cat transaction.log
            "account" : "test",
            "address" : "mgyzVE3XiVDHPCnMzQPg6Wgwicp8KDYrU8",
            "category" : "receive",
            "amount" : 1.00000000
            "account" : "test",
            "address" : "mgyzVE3XiVDHPCnMzQPg6Wgwicp8KDYrU8",
            "category" : "receive",
            "amount" : 1.00000000
--------------------------------------------------------------------
--------------------------------------------------------------------

That is in fact double the execution of the script!

Version of bitcoind - 0.9.3 , taken from here: https://launchpad.net/~bitcoin/+archive/ubuntu/bitcoin

The package building on debian wheezy


please post the whole walletnotify.sh
because for some reason the gettx() gets called two times
before the echo() gets called two times. i am sure it s something
within the script.
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!