You can also try the following:
- You can use local database instead of Redis to store the transaction ID since local database is faster in terms of read/write speed, which can help to filter duplicates.
--snip--
CMIIW, but doesn't Redis has faster performance/response time compared to local database since Redis store the data/index on RAM?
It looks like I missed the condition of in case of a high number of lookups..
I agree that Redis has faster performance/response because it is stored in data/index on Ram however it was said that Redis is not designed to handle a very high number of lookups or writes per second, especially if the keys are not distributed uniformly across the available RAM, and the suggestion of using local database MySQL or PostgreSQL instead of Redis can be an effective way to filter out duplicate transactions in the application since these databases are optimized for fast read and write operation and at the same time can handle a high number of concurrent connections.
It can be done by changing value of minrelaytxfee parameter, but OP's system will not see incoming transaction until it's included on the block. It has some trade-off if OP running a service where the customer want to know the system already detect their transaction.
You are right, I agree that this is a better option since this gives a delay which is probably needed to avoid duplicate transaction.
Did you mistype something? OP already use walletnotify. The only other relevant notification option on Bitcoin Core is blocknotify.
Yeah sorry for that
- You can also look into the transaction confirmation time, if the confirmation time is low then it increases the chances of duplicate transaction. So you can increase the confirmation time for the transaction to make sure you are notified after the transaction is confirmed.
This doesn't make sesnse since walletnotify make notification when the transaction is on mempool (has 0 block confirmation) and included on block (has 1 block confirmation). And time when node receive the transaction or timestamp on block isn't very reliable.
Indeed happen to verify it, my bad for getting some bad sources though I am glad we have you guys to fix things for us
walletnotify is a feature of the Bitcoin Core software that sends a notification to a specified script or program when a new transaction is detected on the network. It sends notifications when a transaction is first seen on the mempool and then again when it is included in a block. So, it is not possible to increase the confirmation time for walletnotify as it is just a notification mechanism and doesn't have any control over the confirmation time of the transactions.
With regard to duplicate, is it a possible solution to use a message queue to buffer incoming notifications and filter duplicates?