TwJSON.Import: add blockchain rescan warning
This commit is contained in:
parent
66c0ca0576
commit
2f5eeb066a
2 changed files with 15 additions and 0 deletions
|
|
@ -36,6 +36,16 @@ class BitcoinTwJSON(TwJSON):
|
|||
few minutes.
|
||||
"""
|
||||
|
||||
blockchain_rescan_warning = """
|
||||
Balances have been updated in the new tracking wallet. However, the wallet
|
||||
is unaware of the used state of any spent addresses without balances, which
|
||||
creates the danger of address reuse, especially when automatic change address
|
||||
selection is in effect.
|
||||
|
||||
To avoid this danger and restore full tracking wallet functionality, rescan
|
||||
the blockchain for used addresses by running ‘mmgen-tool rescan_blockchain’.
|
||||
"""
|
||||
|
||||
@property
|
||||
async def tracking_wallet_exists(self):
|
||||
return await self.twctl.rpc.check_or_create_daemon_wallet(wallet_create=False)
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ class TwJSON:
|
|||
|
||||
class Import(Base,metaclass=AsyncInit):
|
||||
|
||||
blockchain_rescan_warning = None
|
||||
|
||||
async def __init__(self,proto,filename,ignore_checksum=False,batch=False):
|
||||
|
||||
super().__init__(proto)
|
||||
|
|
@ -104,6 +106,9 @@ class TwJSON:
|
|||
|
||||
await self.twctl.rescan_addresses(addrs)
|
||||
|
||||
if self.blockchain_rescan_warning:
|
||||
ymsg('\n' + fmt(self.blockchain_rescan_warning.strip(),indent=' '))
|
||||
|
||||
async def check_and_create_wallet(self):
|
||||
|
||||
if await self.tracking_wallet_exists:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue