fix: check network and masterpub for duplicate accounts

This commit is contained in:
Vlad Stan 2022-08-02 12:59:41 +03:00
parent 35ab1e7d9c
commit a030b20971

View file

@ -103,7 +103,14 @@ async def api_wallet_create_or_update(
wallets = await get_watch_wallets(w.wallet.user, network["name"])
existing_wallet = next(
(ew for ew in wallets if ew.fingerprint == new_wallet.fingerprint), None
(
ew
for ew in wallets
if ew.fingerprint == new_wallet.fingerprint
and ew.network == new_wallet.network
and ew.masterpub == new_wallet.masterpub
),
None,
)
if existing_wallet:
raise ValueError(