diff --git a/wire/msgtx.go b/wire/msgtx.go index 58668b7eca..49291b422d 100644 --- a/wire/msgtx.go +++ b/wire/msgtx.go @@ -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) }