user1307: If you submit a transaction to the network but it hasn't yet be confirmed by a block, is it possible to cancel this transaction?

user19479: From the help of the console :

abandontransaction "txid"

That will tag the transaction as abandonned
 "abandoned": true

After that, you can reselect the input(s) to send it with higher fees
Tested in bitcoin core 0.12.1

user403: Bitcoin-Qt doesn't support anything like that.
Theoretically:
A transaction is canceled by publishing a second transaction which double-spends some of the coins used in the first transaction (this can be a send-to-self). If the second transaction is included in a block before the first one, the first one becomes invalid and can be considered fully cancelled after the second transaction receives 6 confirmations. It's normally not easy to do this. Network nodes won't accept transactions which double-spend coins used in a transaction they already know about. However, nodes gradually forget about transactions if they don't get into blocks, so a transaction could be cancelled if it doesn't make it into a block after several days and both the sender and recipient stop rebroadcasting it.
Bitcoin used to have a feature called transaction replacement. A transaction could be marked as non-final, which prevented this transaction from getting into a block, but allowed the transaction to be cancelled at any time. Satoshi disabled this a while ago, though. Transactions can still be marked as non-final, but they can't be replaced.

1307: <p>If you submit a transaction to the network but it hasn't yet be confirmed by a block, is it possible to cancel this transaction?</p>
 19479: <p>From the help of the console :</p>

<blockquote>
  <p>abandontransaction "txid"</p>
</blockquote>

<p>That will tag the transaction as abandonned</p>

<pre><code> "abandoned": true
</code></pre>

<p>After that, you can reselect the input(s) to send it with higher fees</p>

<p>Tested in bitcoin core 0.12.1</p>
 403: <p>Bitcoin-Qt doesn't support anything like that.</p>

<p>Theoretically:</p>

<p>A transaction is canceled by publishing a second transaction which double-spends some of the coins used in the first transaction (this can be a send-to-self). If the second transaction is included in a block before the first one, the first one becomes invalid and can be considered fully cancelled after the second transaction receives 6 confirmations. It's normally not easy to do this. Network nodes won't accept transactions which double-spend coins used in a transaction they already know about. However, nodes gradually forget about transactions if they don't get into blocks, so a transaction could be cancelled if it doesn't make it into a block after several days and both the sender and recipient stop rebroadcasting it.</p>

<p>Bitcoin used to have a feature called transaction replacement. A transaction could be marked as non-final, which prevented this transaction from getting into a block, but allowed the transaction to be cancelled at any time. Satoshi disabled this a while ago, though. Transactions can still be marked as non-final, but they can't be replaced.</p>
