I'm developping a wallet and I want to listen to the mempool (testnet) for incoming transactions.
I run a node on the same computer so I ping bitcoind every 1 sec with getmempoolinfo.
If getmempoolinfo.size is greater that 1 sec ago, it means there is at least one new transaction
in the mempool, then I get the array of all Tx in the mempool with getrawmempool.
My question : It seems that the new Tx hash is inserted anywhere in the array.
Is there a way to avoid comparing the old rawmempool (~ 1000 Tx) with the new rawmempool
to figure which Tx are new ? Or: why the new Tx are not append at the end
or at the beginning of the array ?