diff --git a/rpcserver.go b/rpcserver.go index 3a481aa4..35c7f52b 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -3441,8 +3441,7 @@ func handleSendRawTransaction(s *rpcServer, cmd interface{}, closeChan <-chan st if err != nil { return nil, rpcDecodeHexError(hexStr) } - var msgTx wire.MsgTx - err = msgTx.Deserialize(bytes.NewReader(serializedTx)) + tx, err := btcutil.NewTxFromBytes(serializedTx) if err != nil { return nil, &btcjson.RPCError{ Code: btcjson.ErrRPCDeserialization, @@ -3451,7 +3450,6 @@ func handleSendRawTransaction(s *rpcServer, cmd interface{}, closeChan <-chan st } // Use 0 for the tag to represent local node. - tx := btcutil.NewTx(&msgTx) acceptedTxs, err := s.cfg.TxMemPool.ProcessTransaction(tx, false, false, 0) if err != nil { // When the error is a rule error, it means the transaction was