From 63f727621b2316b0897018fe4f33fa0320dfaaf6 Mon Sep 17 00:00:00 2001 From: Rakan Alhneiti Date: Wed, 18 Jul 2018 16:25:35 +0200 Subject: [PATCH] Add parity check --- raiden/network/rpc/smartcontract_proxy.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/raiden/network/rpc/smartcontract_proxy.py b/raiden/network/rpc/smartcontract_proxy.py index c77b9b7cdc..933f754f54 100644 --- a/raiden/network/rpc/smartcontract_proxy.py +++ b/raiden/network/rpc/smartcontract_proxy.py @@ -49,6 +49,8 @@ def inspect_client_error(val_err: ValueError, eth_node: str) -> ClientErrorInspe elif eth_node == EthClient.PARITY: if error['code'] == -32010 and 'insufficient funds' in error['message']: return ClientErrorInspectResult.INSUFFICIENT_FUNDS + elif error['code'] == -32010 and 'another transaction with same nonce in the queue': + return ClientErrorInspectResult.TRANSACTION_UNDERPRICED return ClientErrorInspectResult.PROPAGATE_ERROR @@ -81,7 +83,12 @@ def transact(self, function_name: str, *args, **kargs): if action == ClientErrorInspectResult.INSUFFICIENT_FUNDS: raise InsufficientFunds('Insufficient ETH for transaction') elif action == ClientErrorInspectResult.TRANSACTION_UNDERPRICED: - raise ReplacementTransactionUnderpriced() + raise ReplacementTransactionUnderpriced( + 'Transaction was rejected. This is potentially ' + 'caused by the reuse of the previous transaction ' + 'nonce as well as paying an amount of gas less than or ' + 'equal to the previous transaction\'s gas amount', + ) raise e