From b97a2145d8096efd2eed782ad083cb7eecabf22c Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Thu, 7 Nov 2013 10:34:55 -0500 Subject: [PATCH] Try to match bitcoind sendrawtransaction RPC errors. --- rpcserver.go | 12 ++++++------ server.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rpcserver.go b/rpcserver.go index ca905c88..977a6f60 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -751,7 +751,7 @@ func handleSendRawTransaction(s *rpcServer, cmd btcjson.Cmd, walletNotification if err != nil { err := btcjson.Error{ Code: btcjson.ErrDeserialization.Code, - Message: "Unable to deserialize raw tx", + Message: "TX decode failed", } return nil, err } @@ -769,12 +769,12 @@ func handleSendRawTransaction(s *rpcServer, cmd btcjson.Cmd, walletNotification } else { log.Errorf("RPCS: Failed to process transaction %v: %v", tx.Sha(), err) + err = btcjson.Error{ + Code: btcjson.ErrDeserialization.Code, + Message: "TX rejected", + } + return nil, err } - err = btcjson.Error{ - Code: btcjson.ErrDeserialization.Code, - Message: "Failed to process transaction", - } - return nil, err } // If called from websocket code, add a mined tx hashes diff --git a/server.go b/server.go index e3f35e3f..f4c6ffc7 100644 --- a/server.go +++ b/server.go @@ -74,7 +74,7 @@ type peerState struct { outboundPeers *list.List persistentPeers *list.List banned map[string]time.Time - outboundGroups map[string]int + outboundGroups map[string]int maxOutboundPeers int }