Skip to content

Commit a96803c

Browse files
authored
Merge pull request #1575 from evoskuil/master
Add prevout union and comments for database metadata.
2 parents 38ebbf0 + 5d6415f commit a96803c

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

include/bitcoin/system/chain/prevout.hpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,24 @@ class BC_API prevout final
3232
/// CONSENSUS:
3333
/// A height of zero is immature (unspendable) despite unspent state.
3434
///************************************************************************
35-
/// The confirmed chain height of the prevout (zero if not found).
36-
/// Unused if the input owning this prevout is null (coinbase).
37-
size_t height{ zero };
35+
36+
union
37+
{
38+
/// The confirmed chain height of the prevout (zero if not found).
39+
/// Unused if the input owning this prevout is null (coinbase).
40+
size_t height;
41+
42+
/// database: populated with a database identifier for the parent tx.
43+
uint64_t parent{ zero };
44+
};
3845

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

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

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

0 commit comments

Comments
 (0)