<p>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.  </p>

<p>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...</p>

CC BY-SA 4.0
2020-02-18T06:57:14.887Z
2020-02-19T09:49:13.153Z
2020-02-19T09:49:13.153Z
Ishank
<p>There is no <code>walletnotifynew</code> option in Bitcoin, you will have to do deduplication on the application side.</p>

CC BY-SA 4.0
2020-02-18T05:23:03.430Z
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
CC BY-SA 4.0
2020-02-18T05:39:31.397Z
You're probably doing something wrong when calculating the hash then, the transaction will be identical
Raghav Sood
CC BY-SA 4.0
2020-02-18T05:57:15.747Z
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
CC BY-SA 4.0
2020-02-17T13:03:35.487Z
2020-02-17T13:03:35.487Z
Raghav Sood
<p>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.</p>

<p>I heard about walletnotifynew from :-"<a href="https://www.multichain.com/qa/9566/how-can-i-use-walletnotify-command-to-get-notification" rel="nofollow noreferrer">https://www.multichain.com/qa/9566/how-can-i-use-walletnotify-command-to-get-notification</a>"
but its not working .</p>

<p>My bitcon.config file</p>

<pre><code>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  
</code></pre>

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

<pre><code>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 |
+-------+--------------+------------+-------------------------------------+-------------------------------------+---------+------------------------------------------------------------------+----------+--------+


</code></pre>

<bitcoin-core><bitcoind><testnet>
how to use bitcoind "walletnotify" for unique transactions only
Ishank
# how to use bitcoind "walletnotify" for unique transactions only

(Asked by: username_0 on 2020-02-17)

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 |
+-------+--------------+------------+-------------------------------------+-------------------------------------+---------+------------------------------------------------------------------+----------+--------+

**Tags:** bitcoin-core, bitcoind, testnet


---

## 2 answers

### Answer by username_0 on 2020-02-18. Score: 0 | Accepted answer

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...


---

### Answer by username_1 on 2020-02-17. Score: 0

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

> **Comments:**
> **username_0**: 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)  
> **username_1**: You're probably doing something wrong when calculating the hash then, the transaction will be identical  
> **username_0**: 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?  

---

