Merge pull request #6076 from JeremyRand/initial-download-exception
Use specific Exception when chain isn't synced
This commit is contained in:
@@ -68,6 +68,10 @@ if TYPE_CHECKING:
|
|||||||
known_commands = {} # type: Dict[str, Command]
|
known_commands = {} # type: Dict[str, Command]
|
||||||
|
|
||||||
|
|
||||||
|
class NotSynchronizedException(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def satoshis(amount):
|
def satoshis(amount):
|
||||||
# satoshi conversion must not be performed by the parser
|
# satoshi conversion must not be performed by the parser
|
||||||
return int(COIN*Decimal(amount)) if amount not in ['!', None] else amount
|
return int(COIN*Decimal(amount)) if amount not in ['!', None] else amount
|
||||||
@@ -822,7 +826,7 @@ class Commands:
|
|||||||
if not isinstance(wallet, Deterministic_Wallet):
|
if not isinstance(wallet, Deterministic_Wallet):
|
||||||
raise Exception("This wallet is not deterministic.")
|
raise Exception("This wallet is not deterministic.")
|
||||||
if not wallet.is_up_to_date():
|
if not wallet.is_up_to_date():
|
||||||
raise Exception("Wallet not fully synchronized.")
|
raise NotSynchronizedException("Wallet not fully synchronized.")
|
||||||
return wallet.min_acceptable_gap()
|
return wallet.min_acceptable_gap()
|
||||||
|
|
||||||
@command('w')
|
@command('w')
|
||||||
|
|||||||
Reference in New Issue
Block a user