Skip to content

Commit

Permalink
psbt: encode global unknowns
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed Jan 27, 2023
1 parent 19c7c3d commit 5ebbb1b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions btcutil/psbt/psbt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 5ebbb1b

Please sign in to comment.