9

This site shows you unconfirmed bitcoin transactions: https://blockchain.info/unconfirmed-transactions

As I understand it, these unconfirmed transactions are received and rebroadcast by every bitcoin client. Given that they are on my computer, how would I go about extracting this information (i.e. a list of all unconfirmed bitcoin transactions) from the bitcoin client?

schulwitz
  • 335
  • 3
  • 8

1 Answers1

16

The RPC interface includes the getrawmempool command which returns transactions in your memory pool. Transactions stay in your memory pool until they're confirmed, so this is effetively a list your known unconfirmed transacions.

Since getrawmempool returns only a list of transaction ids, you'll have to getrawtransaction <txid> for each transaction id in your memory pool. Remember you can get JSON-formmated output via getrawtransaction <txid> 1.

kaoD
  • 988
  • 6
  • 13
  • It may be out of date, see https://bitcoin.org/en/developer-reference#getrawmempool it appears `getrawmempool` already has extra argument for tx details – jangorecki Aug 28 '15 at 18:11