Try to match bitcoind sendrawtransaction RPC errors.
This commit is contained in:
parent
c1a1e6b6b2
commit
b97a2145d8
2 changed files with 7 additions and 7 deletions
12
rpcserver.go
12
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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue