@@ -32,11 +32,11 @@ class BC_API prevout final
3232 // / CONSENSUS:
3333 // / A height of zero is immature (unspendable) despite unspent state.
3434 // /************************************************************************
35-
3635 union
3736 {
3837 // / The confirmed chain height of the prevout (zero if not found).
3938 // / Unused if the input owning this prevout is null (coinbase).
39+ // / database: unused as validation precedes prevout block association.
4040 size_t height;
4141
4242 // / database: populated with a database identifier for the parent tx.
@@ -47,25 +47,33 @@ class BC_API prevout final
4747 // / CONSENSUS:
4848 // / A mtp of max_uint32 fails locktime maturity (until time overflow).
4949 // /************************************************************************
50- // / The median time past at height (max_uint32 if not found/confirmed).
51- // / Unused if the input owning this prevout is null (coinbase).
52- // / database: unused as validation precedes prevout block association.
53- uint32_t median_time_past{ max_uint32 };
50+ union
51+ {
52+ // / The median time past at height (max_uint32 if not found/confirmed).
53+ // / Unused if the input owning this prevout is null (coinbase).
54+ // / database: unused as validation precedes prevout block association.
55+ uint32_t median_time_past{ max_uint32 };
56+
57+ // / Populated by block.populate() call as internal spends do not
58+ // / require prevout block association for relative locktime checks.
59+ // / So median_time_past is not required as locked is determined here.
60+ bool locked;
61+ };
5462
5563 // /************************************************************************
5664 // / CONSENSUS:
5765 // / An unspent coinbase collision is immature (unspendable) and spent
5866 // / collision is mature (bip30). CB collision presumed precluded by bip34.
5967 // /************************************************************************
60- // / If the input owning this prevout is null (coinbase), this implies that
68+ // / If input owning this prevout is null (coinbase), this implies that
6169 // / all outputs of any duplicate txs are fully spent at height.
6270 // / If the input owning this prevout is not null (not coinbase), this
6371 // / indicates whether the prevout is spent at height (double spend).
64- // / database: unused as validation precedes potential spend block assocs .
72+ // / database: unused as validation precedes prevout block association .
6573 bool spent{ true };
6674
6775 // / The previous output is of a coinbase transaction.
68- // / database: populated as does not require prevout block association.
76+ // / database: populated, does not require prevout block association.
6977 bool coinbase{ false };
7078};
7179
0 commit comments