mirror of
https://github.com/btcsuite/btcd.git
synced 2026-08-13 12:32:51 +02:00
rpc: decode sent raw transactions strictly
This commit is contained in:
parent
81b07f6657
commit
59db835591
1 changed files with 1 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue