Skip to content

Commit 54d135f

Browse files
authored
Merge pull request #1607 from evoskuil/master
Add spender to prevout metadata.
2 parents 4bf2133 + d690e55 commit 54d135f

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

include/bitcoin/system/chain/input.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class BC_API input
164164
/// Public mutable metadata access, copied but not compared for equality.
165165
/// Defaults are set so non-population issues usually imply invalidity.
166166
mutable chain::output::cptr prevout{};
167-
mutable chain::prevout metadata{ zero, max_uint32, true, true };
167+
mutable chain::prevout metadata{ zero, max_uint32, true, true, true };
168168
};
169169

170170
typedef std_vector<input> inputs;

include/bitcoin/system/chain/prevout.hpp

+10-8
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ class BC_API prevout final
3737
{
3838
/// The confirmed chain height of the prevout (zero if not found).
3939
/// Unused if the input owning this prevout is null (coinbase).
40-
size_t height;
40+
size_t height{ zero };
4141

42-
/// node: populated with a database identifier for the parent tx.
43-
uint32_t parent{ zero };
42+
/// node: populated with database identifier for prevout's parent tx.
43+
uint32_t parent;
4444
};
4545

4646
///************************************************************************
@@ -51,13 +51,10 @@ class BC_API prevout final
5151
{
5252
/// The median time past at height (max_uint32 if not found/confirmed).
5353
/// Unused if the input owning this prevout is null (coinbase).
54-
/// node: unused as validation precedes prevout block association.
5554
uint32_t median_time_past{ max_uint32 };
5655

57-
/// node: set via block.populate() 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;
56+
/// node: populated with database identifier for spender's parent tx.
57+
uint32_t spender;
6158
};
6259

6360
///************************************************************************
@@ -77,6 +74,11 @@ class BC_API prevout final
7774
bool inside;
7875
};
7976

77+
/// node: set via block.populate() as internal spends do not
78+
/// require prevout block association for relative locktime checks.
79+
/// So median_time_past is not required as locked is determined here.
80+
bool locked{ true };
81+
8082
/// The previous output is of a coinbase transaction.
8183
/// node: populated, does not require prevout block association.
8284
bool coinbase{ true };

0 commit comments

Comments
 (0)