Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: BlackHatCoiner on August 07, 2020, 07:54:56 PM



Title: TX staying in the memory pool question
Post by: BlackHatCoiner on August 07, 2020, 07:54:56 PM
After all nodes receive a transaction, how much time is the penalty that it will remove them from their memory pool if no one has mined it? Exactly 2 weeks?

I'm asking, because I have some clients that pay me in different addresses each one and then I send the funds of each address to my personal cold wallet.

Are 1 sat/byte transactions ever mined? Before the 2 weeks penalty?


Title: Re: TX staying in the memory pool question
Post by: logfiles on August 07, 2020, 08:08:30 PM
After all nodes receive a transaction, how much time is the penalty that it will remove them from their memory pool if no one has mined it? Exactly 2 weeks?
Yes, by default, it's usually dropped after 2 weeks


Are 1 sat/byte transactions ever mined? Before the 2 weeks penalty?
1 sat/byte transactions can also be mined especially on weekends when the unconfirmed transactions are usually low in the mempool but this all depends on the state of the network. Some weekends, the unconfirmed transactions can still remain high making your 1 sat/byte transaction low priority.


Title: Re: TX staying in the memory pool question
Post by: hosseinimr93 on August 07, 2020, 08:18:59 PM
After all nodes receive a transaction, how much time is the penalty that it will remove them from their memory pool if no one has mined it? Exactly 2 weeks?
That's not exactly 2 weeks.
Nodes usually drop unconfirmed transactions after (about) 14 days. But there is no general rule.
Visit the link below and read the article on Bitcoin Wiki.
Transaction expiration (https://en.bitcoin.it/wiki/Transaction_expiration)


Title: Re: TX staying in the memory pool question
Post by: pooya87 on August 08, 2020, 03:45:39 AM
things that are not consensus rules aren't really fixed rules and we can't rely on such behaviors. when a transaction is made it will stay valid until eternity or until the inputs of it were double spent. a node can decide to keep the transaction forever or it can decide to drop it after 10 minutes or not even accept or relay it at all.

the default preference for bitcoin core nodes is to keep it for 14 days but even if they dropped it right after 14 days were up they can still receive it again from another node that had it in its mempool and were propagating that transaction.

if you are worried about a transaction disappearing from mempools entirely then you can simply go to your wallet or a block explorer and copy the transaction's full raw bytes in hexadecimal and store it somewhere in a text file or something and then broadcast it yourself if you saw it disappear.


Title: Re: TX staying in the memory pool question
Post by: Yogee on August 08, 2020, 04:09:38 AM
things that are not consensus rules aren't really fixed rules and we can't rely on such behaviors. when a transaction is made it will stay valid until eternity or until the inputs of it were double spent. a node can decide to keep the transaction forever or it can decide to drop it after 10 minutes or not even accept or relay it at all.

I had no idea about this. So if a full node operator decides, he can use a "no expiry" set up for valid transactions in its mempool?


Title: Re: TX staying in the memory pool question
Post by: pooya87 on August 08, 2020, 04:18:57 AM
things that are not consensus rules aren't really fixed rules and we can't rely on such behaviors. when a transaction is made it will stay valid until eternity or until the inputs of it were double spent. a node can decide to keep the transaction forever or it can decide to drop it after 10 minutes or not even accept or relay it at all.
I had no idea about this. So if a full node operator decides, he can use a "no expiry" set up for valid transactions in its mempool?

i am not sure how easy or difficult it is to change this simple variable in bitcoin core through the command line but yes essentially it is just a preference that any node can change. older bitcoin core versions had a different setting, other full nodes that are currently running can also have different settings.


Title: Re: TX staying in the memory pool question
Post by: o_e_l_e_o on August 08, 2020, 01:23:12 PM
Here is the relevant code from GitHub (https://github.com/bitcoin/bitcoin/blob/ad2952d17a2af419a04256b10b53c7377f826a27/src/validation.h#L65), which sets the DEFAULT_MEMPOOL_EXPIRY to 336 hours, which is 14 days.

Users can change the expiry period using the command -mempoolexpiry=<n>, which <n> is the number of hours. See https://github.com/bitcoin/bitcoin/blob/e9fc8f6e7f572224d2bd4577eee6d538331ef663/test/functional/mempool_expiry.py#L8


Title: Re: TX staying in the memory pool question
Post by: tranthidung on August 08, 2020, 03:31:55 PM
1 sat/byte transactions can also be mined especially on weekends when the unconfirmed transactions are usually low in the mempool but this all depends on the state of the network. Some weekends, the unconfirmed transactions can still remain high making your 1 sat/byte transaction low priority.
There is priority of your transaction and miners will choose the transaction that bring them highest mining fees.

In the other words, if two transactions with same fee at 1 satoshi/ byte.
  • Transaction A has its size at 226 bytes (1 input, 2 outputs, P2PKH)
  • Transaction A has its size at 260 bytes (1 input, 3 outputs, P2PKH)
Miners will prioritize to confirm transaction B because they will get more fees from it. Imagine when Bitcoin dipped to below $4k in February, you saw it but it does not mean that you actually were able to buy bitcoin at the price.


Title: Re: TX staying in the memory pool question
Post by: DdmrDdmr on August 08, 2020, 04:02:58 PM
This seems to show unconfirmed TXs in the mempool as far back as 3 weeks ago:
https://blockchair.com/bitcoin/mempool/transactions?s=time(asc)#
I believe it is only displaying partial information though (i.e. not displaying the oldest TXs).

Is there a decent site that displays all pending TXs (specifically so as to see how far back they go in time, and what size and fees were implied)? (not sure if rebroadcasted TXs will vary their "Time (UTC)" data as a result, overiding the initial information for this data variable).