refactor: SpanReader without nVersion

The field is unused, so remove it.

This is also required for future commits.
This commit is contained in:
MarcoFalke
2023-11-17 16:32:29 +01:00
parent c252a0fc0f
commit fac39b56b7
9 changed files with 25 additions and 34 deletions

View File

@ -382,7 +382,7 @@ struct PSBTInput
}
// Type is compact size uint at beginning of key
SpanReader skey{s.GetVersion(), key};
SpanReader skey{key};
uint64_t type = ReadCompactSize(skey);
// Do stuff based on type
@ -590,7 +590,7 @@ struct PSBTInput
} else if (key.size() != 65) {
throw std::ios_base::failure("Input Taproot script signature key is not 65 bytes");
}
SpanReader s_key{s.GetVersion(), Span{key}.subspan(1)};
SpanReader s_key{Span{key}.subspan(1)};
XOnlyPubKey xonly;
uint256 hash;
s_key >> xonly;
@ -632,7 +632,7 @@ struct PSBTInput
} else if (key.size() != 33) {
throw std::ios_base::failure("Input Taproot BIP32 keypath key is not at 33 bytes");
}
SpanReader s_key{s.GetVersion(), Span{key}.subspan(1)};
SpanReader s_key{Span{key}.subspan(1)};
XOnlyPubKey xonly;
s_key >> xonly;
std::set<uint256> leaf_hashes;
@ -807,7 +807,7 @@ struct PSBTOutput
}
// Type is compact size uint at beginning of key
SpanReader skey{s.GetVersion(), key};
SpanReader skey{key};
uint64_t type = ReadCompactSize(skey);
// Do stuff based on type
@ -856,7 +856,7 @@ struct PSBTOutput
}
std::vector<unsigned char> tree_v;
s >> tree_v;
SpanReader s_tree{s.GetVersion(), tree_v};
SpanReader s_tree{tree_v};
if (s_tree.empty()) {
throw std::ios_base::failure("Output Taproot tree must not be empty");
}
@ -1060,7 +1060,7 @@ struct PartiallySignedTransaction
}
// Type is compact size uint at beginning of key
SpanReader skey{s.GetVersion(), key};
SpanReader skey{key};
uint64_t type = ReadCompactSize(skey);
// Do stuff based on type