Skip to content

Commit

Permalink
Merge pull request #1575 from evoskuil/master
Browse files Browse the repository at this point in the history
Add prevout union and comments for database metadata.
  • Loading branch information
evoskuil authored Jan 3, 2025
2 parents 38ebbf0 + 5d6415f commit a96803c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions include/bitcoin/system/chain/prevout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,24 @@ class BC_API prevout final
/// CONSENSUS:
/// A height of zero is immature (unspendable) despite unspent state.
///************************************************************************
/// The confirmed chain height of the prevout (zero if not found).
/// Unused if the input owning this prevout is null (coinbase).
size_t height{ zero };

union
{
/// The confirmed chain height of the prevout (zero if not found).
/// Unused if the input owning this prevout is null (coinbase).
size_t height;

/// database: populated with a database identifier for the parent tx.
uint64_t parent{ zero };
};

///************************************************************************
/// CONSENSUS:
/// A mtp of max_uint32 fails locktime maturity (until time overflow).
///************************************************************************
/// The median time past at height (max_uint32 if not found/confirmed).
/// Unused if the input owning this prevout is null (coinbase).
/// database: unused as validation precedes prevout block association.
uint32_t median_time_past{ max_uint32 };

///************************************************************************
Expand All @@ -53,9 +61,11 @@ class BC_API prevout final
/// all outputs of any duplicate txs are fully spent at height.
/// If the input owning this prevout is not null (not coinbase), this
/// indicates whether the prevout is spent at height (double spend).
/// database: unused as validation precedes potential spend block assocs.
bool spent{ true };

/// The previous output is of a coinbase transaction.
/// database: populated as does not require prevout block association.
bool coinbase{ false };
};

Expand Down

0 comments on commit a96803c

Please sign in to comment.