mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-04 12:55:02 +02:00
Remove unused (and broken) functionality in SpanReader
This removes the ability to set an offset in the SpanReader constructor,
as the current code is broken. All call sites use pos=0, so it is actually
unused. If future call sites need it, SpanReader{a, b, c, d} is equivalent
to SpanReader{a, b, c.subspan(d)}.
It also removes the ability to deserialize from SpanReader directly from
the constructor. This too is unused, and can be more idiomatically
simulated using (SpanReader{a, b, c} >> x >> y >> z) instead of
SpanReader{a, b, c, x, y, z}.
This commit is contained in:
@@ -98,7 +98,7 @@ std::optional<SignetTxs> SignetTxs::Create(const CBlock& block, const CScript& c
|
||||
// no signet solution -- allow this to support OP_TRUE as trivial block challenge
|
||||
} else {
|
||||
try {
|
||||
SpanReader v{SER_NETWORK, INIT_PROTO_VERSION, signet_solution, 0};
|
||||
SpanReader v{SER_NETWORK, INIT_PROTO_VERSION, signet_solution};
|
||||
v >> tx_spending.vin[0].scriptSig;
|
||||
v >> tx_spending.vin[0].scriptWitness.stack;
|
||||
if (!v.empty()) return std::nullopt; // extraneous data encountered
|
||||
|
||||
Reference in New Issue
Block a user