GLOBAL_XPUB
to BIP 174. This PR adds support for (de)serializing this field and displaying it in decodepsbt
.
GLOBAL_XPUB
to BIP 174. This PR adds support for (de)serializing this field and displaying it in decodepsbt
.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
515@@ -424,6 +516,18 @@ struct PartiallySignedTransaction
516 OverrideStream<Stream> os(&s, s.GetType(), s.GetVersion() | SERIALIZE_TRANSACTION_NO_WITNESS);
517 SerializeToVector(os, *tx);
518
519+ // Write xpubs
520+ for (const auto xpub_pair : xpubs) {
521+ for (const auto xpub : xpub_pair.second) {
suggested change to reference instead of copy in range loops:
0- for (const auto xpub_pair : xpubs) {
1- for (const auto xpub : xpub_pair.second) {
2+ for (const auto& xpub_pair : xpubs) {
3+ for (const auto& xpub : xpub_pair.second) {
98- }
99-}
100-
101-// Deserialize HD keypaths into a map
102-template<typename Stream>
103-void DeserializeHDKeypaths(Stream& s, const std::vector<unsigned char>& key, std::map<CPubKey, KeyOriginInfo>& hd_keypaths)
/fuzz/script.cpp
which is looking for these functions.
SerializeToVector, UnserializeFromVector, DeserializeHDKeypaths, and SerializeHDKeypaths
were in sign.h where PSBT was originally implemented. Since all of the PSBT serialization
has moved to its own file, these functions should follow.
CExtPubKey does not store the version bytes for the extended public key.
We store these so that a CExtPubKey can be serialized and deserialized with
the same version bytes.