diff --git a/rpcserver.go b/rpcserver.go index e02c81c3..dcb143c2 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -606,7 +606,15 @@ func handleSendRawTransaction(s *rpcServer, cmd btcjson.Cmd, walletNotification tx := btcutil.NewTx(msgtx) err = s.server.txMemPool.ProcessTransaction(tx) if err != nil { - log.Errorf("RPCS: Failed to process transaction: %v", err) + // When the error is a rule error, it means the transaction was + // simply rejected as opposed to something actually going wrong, + // so log it as such. Otherwise, something really did go wrong, + // so log it as an actual error. + if _, ok := err.(TxRuleError); ok { + log.Debugf("RPCS: Rejected transaction %v: %v", txHash, err) + } else { + log.Errorf("RPCS: Failed to process transaction %v: %v", txHash, err) + } err = btcjson.Error{ Code: btcjson.ErrDeserialization.Code, Message: "Failed to process transaction",