From 57f238d48e5c2ed47514082d66cf5f6b2e8cec68 Mon Sep 17 00:00:00 2001 From: tecnovert Date: Fri, 14 Jun 2024 12:27:45 +0200 Subject: [PATCH] Add local smsg addresses if missing. --- basicswap/basicswap.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index 06ed4a4..77d59d9 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -7553,9 +7553,11 @@ class BasicSwap(BaseApp): use_session = self.openSession(session) try: mode = '-' if active_ind == 0 else '+' - self.callrpc('smsglocalkeys', ['recv', mode, address]) + rv = self.callrpc('smsglocalkeys', ['recv', mode, address]) + if 'not found' in rv['result']: + self.callrpc('smsgaddlocaladdress', [address,]) + self.callrpc('smsglocalkeys', ['anon', '-', address]) values = {'active_ind': active_ind, 'addr': address, 'use_type': use_type} - query_str: str = 'UPDATE smsgaddresses SET active_ind = :active_ind' if addressnote is not None: values['note'] = addressnote