Author

Topic: How to get unconfirmed transactions? (Read 170 times)

legendary
Activity: 2212
Merit: 1008
December 14, 2020, 03:07:20 PM
#11
there are people on the forum who offer an acceleration service, do not know exactly how it works technically, but what I have read is that they have already been able to help many others, and the next time keep an eye on the fee for what you have to do with it yourself, the fee can vary enormously per day.
jr. member
Activity: 34
Merit: 6
December 14, 2020, 05:45:32 AM
#10
You mentioned connecting dozens of nodes here. Do I need to fill in these node addresses in the Bitcoind.conf configuration file? Or fill in many node addresses in my code? Thank you very much, I am a enthusiast who just participated in learning blockchain
In Bitcoin.conf file, you should be able to add as many nodes as you want but there will be a restriction on the number of nodes your client will connect to. You can try opening port 8333 to allow other nodes to connect to you, the node count should increase gradually as your IP address gets relayed and propagated through addr messages within nodes.

Generally, the transactions that are non-standard, ie. valid transactions but are do not pass the standardness check[1] enforced by the nodes, will not be accepted by your node. They could still be accepted into a block however. Those are the kinds of transactions that you'll probably never see in the mempool, but only in blocks mined by miners.

By attempting to connect to as many node as possible, you could allow your bitcoind to potentially have more sources for the transactions to be relayed to you, deceasing the chances of certain transactions having low propagation (Txes with low relay fee, etc) but are otherwise standard and valid.

[1] https://github.com/bitcoin/bitcoin/blob/master/src/consensus/validation.h#L21

Thank you very much
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
December 14, 2020, 05:30:18 AM
#9
You mentioned connecting dozens of nodes here. Do I need to fill in these node addresses in the Bitcoind.conf configuration file? Or fill in many node addresses in my code? Thank you very much, I am a enthusiast who just participated in learning blockchain
In Bitcoin.conf file, you should be able to add as many nodes as you want but there will be a restriction on the number of nodes your client will connect to. You can try opening port 8333 to allow other nodes to connect to you, the node count should increase gradually as your IP address gets relayed and propagated through addr messages within nodes.

Generally, the transactions that are non-standard, ie. valid transactions but are do not pass the standardness check[1] enforced by the nodes, will not be accepted by your node. They could still be accepted into a block however. Those are the kinds of transactions that you'll probably never see in the mempool, but only in blocks mined by miners.

By attempting to connect to as many node as possible, you could allow your bitcoind to potentially have more sources for the transactions to be relayed to you, deceasing the chances of certain transactions having low propagation (Txes with low relay fee, etc) but are otherwise standard and valid.

[1] https://github.com/bitcoin/bitcoin/blob/master/src/consensus/validation.h#L21
jr. member
Activity: 34
Merit: 6
December 14, 2020, 04:55:41 AM
#8
Thank you, are all unconfirmed transactions in the memory pool? Will there be confirmed transactions in the memory pool?

As ranochigo wrote, it'll only give you the mempool of the node you're querying, which is not complete and only has transactions it knows. But you can connect to several dozen different nodes, checking that the ones you're connecting to aren't peers of any others you're sampling, run getrawmempool on all of them and intersect all the transactions in a set to get the majority of the unconfirmed transactions.

You mentioned connecting dozens of nodes here. Do I need to fill in these node addresses in the Bitcoind.conf configuration file? Or fill in many node addresses in my code? Thank you very much, I am a enthusiast who just participated in learning blockchain
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
December 14, 2020, 04:39:00 AM
#7
Thank you, are all unconfirmed transactions in the memory pool? Will there be confirmed transactions in the memory pool?

As ranochigo wrote, it'll only give you the mempool of the node you're querying, which is not complete and only has transactions it knows. But you can connect to several dozen different nodes, checking that the ones you're connecting to aren't peers of any others you're sampling, run getrawmempool on all of them and intersect all the transactions in a set to get the majority of the unconfirmed transactions.
jr. member
Activity: 34
Merit: 6
December 14, 2020, 04:38:23 AM
#6
Thank you, are all unconfirmed transactions in the memory pool?
Not all. See my response.
Will there be confirmed transactions in the memory pool?
No. Transactions are removed from mempool when they're in the block.

thank you very much
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
December 14, 2020, 04:27:43 AM
#5
Thank you, are all unconfirmed transactions in the memory pool?
Not all. See my response.
Will there be confirmed transactions in the memory pool?
No. Transactions are removed from mempool when they're in the block.
jr. member
Activity: 34
Merit: 6
December 14, 2020, 04:26:18 AM
#4
Use the getrawmempool RPC call to get a snapshot of the mempool. If you only want the transaction IDs inside the mempool, pass verbose=false as a parameter i.e. getrawmempool(false).

For each transaction you then call getrawtransaction to get the inputs, outputs and other stuff you need to get.

Thank you, are all unconfirmed transactions in the memory pool? Will there be confirmed transactions in the memory pool?
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
December 14, 2020, 04:00:21 AM
#3
If the transaction is included in the block, then the transaction is already confirmed.

If you want to look at unconfirmed transaction (ie. transactions that has not yet been included in the block), you have to refer to your mempool. There is no perfect source of information for the unconfirmed transactions as mempool is just a representation of the transactions that has been relayed to you. It does not represent all the transactions that could be included in the next block, be it due to poor propagation or miner not broadcasting them to others.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
December 14, 2020, 03:56:23 AM
#2
Use the getrawmempool RPC call to get a snapshot of the mempool. If you only want the transaction IDs inside the mempool, pass verbose=false as a parameter i.e. getrawmempool(false).

For each transaction you then call getrawtransaction to get the inputs, outputs and other stuff you need to get.
jr. member
Activity: 34
Merit: 6
December 14, 2020, 03:44:07 AM
#1
I have built a bitcoind node service. I want to quickly obtain unconfirmed transactions from the block and perform analysis. I read the vin and vout in the block and cannot know which are unconfirmed transactions. I need to build a btc Mining pool to quickly get unconfirmed transactions?
Jump to: