@@ -25,57 +25,28 @@ namespace libbitcoin {
2525namespace system {
2626namespace chain {
2727
28- // Defaults are set so non-population issues usually imply invalidity.
2928class BC_API prevout final
3029{
3130public:
32- // /************************************************************************
33- // / CONSENSUS:
34- // / A height of zero is immature (unspendable) despite unspent state.
35- // /************************************************************************
36- union
37- {
38- // / Unused for coinbase.
39- // / The confirmed height of the prevout or max_uint32.
40- size_t prevout_height{ max_uint32 };
41-
42- // / node: populated with database identifier for the parent tx.
43- // / Link::terminal must derive from default of max_uint32.
44- uint32_t parent_tx;
45- };
31+ // / chain/node: prevout is of a coinbase tx.
32+ bool coinbase{ true };
4633
47- // /************************************************************************
48- // / CONSENSUS:
49- // / A mtp of max_uint32 fails locktime maturity (until time overflow).
50- // /************************************************************************
51- union
52- {
53- // / Unused for coinbase.
54- // / The median time past at confirmed prevout block or max_uint32.
55- uint32_t median_time_past{ max_uint32 };
34+ // / chain: confirmed prevout mtp or max_uint32.
35+ uint32_t median_time_past{ max_uint32 };
5636
57- // / node: populated with database identifier for the input/point.
58- // / Link::terminal must derive from default of max_uint32.
59- uint32_t point_link;
60- };
37+ // / chain: confirmed prevout height or max_uint32.
38+ size_t prevout_height{ max_uint32 };
6139
62- // /************************************************************************
63- // / CONSENSUS:
64- // / An unspent coinbase collision is immature (unspendable) and spent
65- // / collision is mature [bip30]. CB collision presumed precluded by bip34.
66- // / This is NOT guarded by system::chain confirmation checks.
67- // /************************************************************************
68- // / The confirmed height of the spender or max_uint32.
40+ // / chain: confirmed spender height or max_uint32.
6941 uint32_t spender_height{ max_uint32 };
7042
71- // / node: set via block.populate() as internal spends do not require
72- // / prevout block association for relative locktime checks. So
73- // / median_time_past is not required as locked is determined here.
74- bool locked{ true };
43+ // / node: database identifier for the parent tx.
44+ // / Link::terminal must align with link defaults of max_uint32.
45+ uint32_t parent_tx{ max_uint32 };
7546
76- // / The previous output is of a coinbase transaction .
77- // / node: populated, does not require prevout block association .
78- bool coinbase{ true };
47+ // / node: database identifier for input/point .
48+ // / Link::terminal must align with link defaults of max_uint32 .
49+ uint32_t point_link{ max_uint32 };
7950};
8051
8152} // namespace chain
0 commit comments