Skip to content

Commit

Permalink
wire: modify SerializeNoWitness to use cached version if available
Browse files Browse the repository at this point in the history
  • Loading branch information
Roasbeef committed Dec 5, 2023
1 parent e2a7cd1 commit d045a70
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wire/msgtx.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,10 @@ func (msg *MsgTx) Serialize(w io.Writer) error {
// Serialize, however even if the source transaction has inputs with witness
// data, the old serialization format will still be used.
func (msg *MsgTx) SerializeNoWitness(w io.Writer) error {
if msg.cachedSeralizedNoWitness != nil {
w.Write(msg.cachedSeralizedNoWitness)
}

return msg.BtcEncode(w, 0, BaseEncoding)
}

Expand Down

0 comments on commit d045a70

Please sign in to comment.