Generalize/simplify VectorReader into SpanReader

This commit is contained in:
Pieter Wuille
2021-12-01 14:40:25 -05:00
parent 26a1147ce5
commit 2c35a93b3c
8 changed files with 35 additions and 36 deletions

View File

@@ -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 {
VectorReader v(SER_NETWORK, INIT_PROTO_VERSION, signet_solution, 0);
SpanReader v{SER_NETWORK, INIT_PROTO_VERSION, signet_solution, 0};
v >> tx_spending.vin[0].scriptSig;
v >> tx_spending.vin[0].scriptWitness.stack;
if (!v.empty()) return std::nullopt; // extraneous data encountered