Currently, there is no good way to identify which transaction replaced an existing one in the mempool. If I have a system that is monitoring a tx and that tx is RBF'd, all our API endpoint returns is a blockHeight of -3 (conflicting) without a pointer to the conflicting tx.
This PR adds the replacedByTxid field to the transaction schema and records it when a tx is RBF'd. This required a refactor of the pruneMempool method to reliably record the replacedByTxid where appropriate. The result is a simpler, more elegant pruneMempool method.
Currently, there is no good way to identify which transaction replaced an existing one in the mempool. If I have a system that is monitoring a tx and that tx is RBF'd, all our API endpoint returns is a blockHeight of -3 (conflicting) without a pointer to the conflicting tx.
This PR adds the
replacedByTxid
field to the transaction schema and records it when a tx is RBF'd. This required a refactor of thepruneMempool
method to reliably record thereplacedByTxid
where appropriate. The result is a simpler, more elegantpruneMempool
method.