Trying to patch Core ZMQ "rawtx" topic to only publish unconfirmed transactions: How?



Summary:

The email thread on the bitcoin-dev mailing list discusses an issue with the ZeroMQ topic "rawtx," which emits a raw transaction when it appears on the mempool. However, it also emits the same transaction once it's already confirmed, causing problems with software that de-duplicates arrays. The proposed solution is to instruct Core to only publish unconfirmed transactions, but it requires editing the source code as there are no configuration or command-line options available. A draft PR has been opened to add a rawmempooltx publisher, but changes to the chain notifications in interfaces/chain.h would be required for a mempool transaction publisher with both the raw transaction and transaction fee. There is a discussion on which function should be patched in src/zmq/zmqnotificationinterface.cpp to only publish unconfirmed transactions, and Jonas Schnelli's suggestion of adding an `if (!pblock)` check from several years ago is no longer applicable as the function he was referencing no longer exists.


Updated on: 2023-06-15T03:02:29.897639+00:00