Does an Unconfirmed Transaction Lock UTXOs?

0
3


There isn’t any “the” UTXO set.

The UTXO set mannequin is mind-set concerning the state of the Bitcoin blockchain, and one thing that guides developement. However it’s usually not materialized as an precise knowledge construction in its entirety, and there is not only a single one.

Internally in Bitcoin Core, UTXO units are represented by the summary CCoinsView class. There are a number of implementations for it:

  • one which’s backed by an on-disk database.
  • one which’s backed by a set of cached in-memory adjustments on prime of one other UTXO set (used to characterize the UTXO set of the currently-active blockchain).
  • one which’s backed by the mempool on prime of one other

When validating lose transactions which might be being relayed and accepted into the mempool, the mempool’s UTXO set is used (which consists of all UTXOs within the presently lively block, plus implicitly all outputs from mempool transactions added, plus implicitly all inputs from mempool transactions deleted).

When validating a block, the UTXO set equivalent to the presently lively block is used, which doesn’t embrace the implicit adjustments as a result of mempool.


To reply your questions:

Will the 5btc output be deducted(locked to B’s tackle) from the utxo set whereas the txn is within the mempool(unconfirmed)?

From the mempool’s implicitly-defined UTXO set, sure. From the blockchain’s UTXO set, no.

If no, can A once more use the 5BTC from the utxo set?

That is unrelated to how the database is modeled, however ruled by mempool substitute insurance policies. Utilizing RBF (replace-by-fee) it’s in some circumstances doable to exchange a mempool transaction with a higher-feerate one. This occurs earlier than validation in opposition to the mempool’s UTXO set occurs.

LEAVE A REPLY

Please enter your comment!
Please enter your name here