Bitcoin Forum
May 17, 2024, 11:35:54 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: watch new Tx in mempool (testnet)  (Read 938 times)
redPanda (OP)
Member
**
Offline Offline

Activity: 65
Merit: 16


View Profile
December 17, 2015, 02:00:21 PM
 #1

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 ?
redPanda (OP)
Member
**
Offline Offline

Activity: 65
Merit: 16


View Profile
January 08, 2016, 04:18:46 PM
 #2

UPDATE: no answer ?
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3402
Merit: 6641


Just writing some code


View Profile WWW
January 08, 2016, 08:26:54 PM
 #3

UPDATE: no answer ?
I do not think there is any way to do this. Bitcoin Core has a few notification things that it can do but not for every new transaction you receive. You can have it for every new block and transaction relevant to you (so not when a new transaction is added to the mempool). You could modify the source code and add that function in yourself though.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!