diff --git a/monero/backends/jsonrpc.py b/monero/backends/jsonrpc.py index 81d7277..4e732f8 100644 --- a/monero/backends/jsonrpc.py +++ b/monero/backends/jsonrpc.py @@ -369,7 +369,8 @@ _err2exc = { -16: exceptions.TransactionNotPossible, -17: exceptions.NotEnoughMoney, -20: exceptions.AmountIsZero, - -37: exceptions.NotEnoughUnlockedMoney, # PR pending: https://github.com/monero-project/monero/pull/3197 - -38: exceptions.NoDaemonConnection, # PR 3197 + -37: exceptions.NotEnoughUnlockedMoney, + -38: exceptions.NoDaemonConnection, + -43: exceptions.WalletIsNotDeterministic, # https://github.com/monero-project/monero/pull/4653 -32601: MethodNotFound, } diff --git a/monero/exceptions.py b/monero/exceptions.py index ef2bca3..389fbb5 100644 --- a/monero/exceptions.py +++ b/monero/exceptions.py @@ -38,3 +38,6 @@ class TransactionNotFound(AccountException): class SignatureCheckFailed(MoneroException): pass + +class WalletIsNotDeterministic(MoneroException): + pass diff --git a/utils/walletdump.py b/utils/walletdump.py index 90595b9..bdf6b5f 100755 --- a/utils/walletdump.py +++ b/utils/walletdump.py @@ -4,7 +4,8 @@ import logging import operator import re -from monero.backends.jsonrpc import JSONRPCWallet +from monero import exceptions +from monero.backends.jsonrpc import JSONRPCWallet, RPCError from monero.wallet import Wallet def url_data(url): @@ -54,6 +55,10 @@ print( addr=a2str(masteraddr), total=w.balance(), unlocked=w.balance(unlocked=True))) +try: + seed = w.seed() +except (exceptions.WalletIsNotDeterministic, RPCError): # FIXME: Remove RPCError once PR#4563 is merged in monero + seed = '[--- wallet is not deterministic and has no seed ---]' print( "Keys:\n" \ " private spend: {ssk}\n" \ @@ -65,7 +70,7 @@ print( svk=w.view_key(), psk=masteraddr.spend_key(), pvk=masteraddr.view_key(), - seed=w.seed() + seed=seed )) if len(w.accounts) > 1: