psbt: encode global unknowns

This commit is contained in:
Oliver Gugger 2023-01-27 15:30:44 +01:00
parent 19c7c3d853
commit 5ebbb1bb91
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

View File

@ -319,6 +319,15 @@ func (p *Packet) Serialize(w io.Writer) error {
return err
}
// Unknown is a special case; we don't have a key type, only a key and
// a value field
for _, kv := range p.Unknowns {
err := serializeKVpair(w, kv.Key, kv.Value)
if err != nil {
return err
}
}
// With that our global section is done, so we'll write out the
// separator.
separator := []byte{0x00}