How Long Does a Transaction Typically Remain in the Mempool If Unconfirmed?
The duration a transaction remains in a mempool is variable and depends on the node's policy and network congestion. Most Bitcoin Core nodes, for example, will keep an unconfirmed transaction in their mempool for a default period of 72 hours.
If the transaction is not confirmed within this time, it is automatically dropped to prevent the mempool from being permanently clogged with stale data. However, if the transaction is dropped from one node, it may still be held by others, or it can be re-broadcast by the sender.