[#Coin-04] = Coin :mrdocs: A UTXO entry. == Synopsis Declared in `<coins.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class Coin; ---- == Description Serialized format: * VARINT((height << 1) | (coinbase ? 1 : 0)) * the non‐spent CTxOut (via TxOutCompression) == Member Functions [cols="1,4"] |=== | Name| Description | xref:Coin-04/2constructor-03.adoc[`Coin`] [.small]#[constructor]# | Constructors | xref:Coin-04/Clear.adoc[`Clear`] | Reset the coin to the null, spent state. | xref:Coin-04/DynamicMemoryUsage.adoc[`DynamicMemoryUsage`] | Report the heap memory used by this coin beyond its own size. | xref:Coin-04/IsCoinBase.adoc[`IsCoinBase`] | Report whether the containing transaction was a coinbase. | xref:Coin-04/IsSpent.adoc[`IsSpent`] | Either this coin never existed (see e.g. coinEmpty in coins.cpp), or it did exist and has been spent. | xref:Coin-04/Serialize.adoc[`Serialize`] | Serialize the coin to the given stream. | xref:Coin-04/Unserialize.adoc[`Unserialize`] | Read the coin from the given stream. |=== == Data Members [cols="1,4"] |=== | Name| Description | xref:Coin-04/fCoinBase.adoc[`fCoinBase`] | whether containing transaction was a coinbase | xref:Coin-04/nHeight.adoc[`nHeight`] | at which height this containing transaction was included in the active block chain | xref:Coin-04/out.adoc[`out`] | unspent transaction output |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:AccessByTxid.adoc[`AccessByTxid`] | Utility function to find any unspent output with a given txid. This function can be quite expensive because in the event of a transaction which is not found in the cache, it can cause up to MAX_OUTPUTS_PER_BLOCK lookups to database, so it should be used with care. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#