0

while using bitcoind "walletnotify" my curl command is getting 3 hits generating 3 unique transaction hashes but requirement is to execute only once for unique transactions.

I heard about walletnotifynew from :-"https://www.multichain.com/qa/9566/how-can-i-use-walletnotify-command-to-get-notification" but its not working .

My bitcon.config file

rpcuser=root
rpcpassword=root
testnet=1
test.rpcport=8332
rpcallowip=127.0.0.1
server=1
rpcbind=127.0.0.1
walletnotifynew=/home/scripts/transaction.sh %s
#walletnotify=curl -d "txid=$1" http://127.0.0.1:8888/api/v1/listen-transaction %s  

Database entry i was transferring the withing same wallet still three incoming but there should be only one entry of outgoing

select * from transaction;
+-------+--------------+------------+-------------------------------------+-------------------------------------+---------+------------------------------------------------------------------+----------+--------+
| tx_id | amount       | made_on    | sent_from_address                   | sent_to_address                     | success | transaction_hash                                                 | tx_type  | userid |
+-------+--------------+------------+-------------------------------------+-------------------------------------+---------+------------------------------------------------------------------+----------+--------+
|    53 | 0.0000000000 | 2020-02-17 | NULL                                | 2NFgnEMcE4kvvCLXK6uiEgb3dZuVLGUK75v |       1 | 11acce71f3d10330e10d70f5ee974abe5d216ec188309b61d1f751a1615d439d | INCOMING |   NULL |
|    52 | 0.0000000000 | 2020-02-17 | NULL                                | 2NFgnEMcE4kvvCLXK6uiEgb3dZuVLGUK75v |       1 | bc3267ffcc44b8d526cbb1de19f653bc90aedda4dc4fc2fc9ab18a954e7347c1 | INCOMING |   NULL |
|    50 | 0.0001000000 | 2020-02-17 | 2N6MqukeqDftwXsVDBSBkDrnbvzaXoNwNhi | 2NFgnEMcE4kvvCLXK6uiEgb3dZuVLGUK75v |       1 | 9bb2ab339930a68f33ce3521bee46363cbd29a87c68b718c4ae415a3ba53b7b8 | OUTGOING |      1 |
|    51 | 0.0000000000 | 2020-02-17 | NULL                                | 2NFgnEMcE4kvvCLXK6uiEgb3dZuVLGUK75v |       1 | 2e0976cd310fe1d740227cec0ae615dae668d4efeea740e51b81cb1b89dd2a47 | INCOMING |   NULL |
+-------+--------------+------------+-------------------------------------+-------------------------------------+---------+------------------------------------------------------------------+----------+--------+


2 Answers 2

0

There is no walletnotifynew option in Bitcoin, you will have to do deduplication on the application side.

3
  • but how i can deduplication ? i m getting new transaction hash for same transaction when i m sending a coin within same wallet (sending,receiving,confirmation)
    – Ishank
    Feb 18, 2020 at 5:23
  • You're probably doing something wrong when calculating the hash then, the transaction will be identical Feb 18, 2020 at 5:39
  • may be not because i m not generating transaction hash i m just listening it and using it, you want to see my listener class?
    – Ishank
    Feb 18, 2020 at 5:57
0

problem was that i was receiving testnet bitcoins that were requested in the morning and also their first confirmations i were deleting the entries from the database which confused me a little bit for my written code but the code was working absolutely fine, Silly lol.

Secondly my both send and listen api were getting hits simultaneously for which i added an wait thread in the listen api so that send transaction can be stored in the database first and then listen transaction...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.