user19338: Sometimes confirmation process is very slow. I think that is because of the price of the fee. In that time, is it possible to cancel the unconfirmed transaction and re-send with higher transaction fee?  Are there any expiry features? E.g. the transaction will be canceled after 7 days?
As far as I read other posts, the answer is NO. If so, do I need to wait for the confirmation forever? For instance, when I set a zero transaction fee accidentally.

user6256: The newest version of bitcoin core 0.12 introduced a feature called replace by fee. This can be used to issue a transaction with a higher fee spending coins that have not yet been picked up in a block.  This can be used to send funds in a stuck transaction to a new address and the hope is that by including a fee this will get picked up by the miners faster than a transaction with no fees.
Here is a link to the tools used to create this kind of transaction:
https://github.com/petertodd/replace-by-fee-tools
As you correctly noted there is no timeframe in which a transaction expires.

user208: In addition to Mark S.'s answer, since Bitcoin Core 0.12 there actually is an expiration in the mempool, which evicts unconfirmed transactions after N hours, where N is set by -mempoolexpiry, and defaults to 72 hours.
This is not a reliable feature, as wallets (and really, anyone) can rebroadcast the transaction, but helps keeping the mempool fresh.

19338: <p>Sometimes confirmation process is very slow. I think that is because of the price of the fee. In that time, is it possible to cancel the unconfirmed transaction and re-send with higher transaction fee?  Are there any expiry features? E.g. the transaction will be canceled after 7 days?</p>

<p>As far as I read other posts, the answer is NO. If so, do I need to wait for the confirmation forever? For instance, when I set a zero transaction fee accidentally.</p>
 6256: <p>The newest version of bitcoin core 0.12 introduced a feature called replace by fee. This can be used to issue a transaction with a higher fee spending coins that have not yet been picked up in a block.  This can be used to send funds in a stuck transaction to a new address and the hope is that by including a fee this will get picked up by the miners faster than a transaction with no fees.</p>

<p>Here is a link to the tools used to create this kind of transaction:
<a href="https://github.com/petertodd/replace-by-fee-tools" rel="nofollow">https://github.com/petertodd/replace-by-fee-tools</a></p>

<p>As you correctly noted there is no timeframe in which a transaction expires.</p>
 208: <p>In addition to Mark S.'s answer, since Bitcoin Core 0.12 there actually is an expiration in the mempool, which evicts unconfirmed transactions after N hours, where N is set by <code>-mempoolexpiry</code>, and defaults to 72 hours.</p>

<p>This is not a reliable feature, as wallets (and really, anyone) can rebroadcast the transaction, but helps keeping the mempool fresh.</p>
