fix: check network and masterpub for duplicate accounts
This commit is contained in:
parent
35ab1e7d9c
commit
a030b20971
1 changed files with 8 additions and 1 deletions
|
|
@ -103,7 +103,14 @@ async def api_wallet_create_or_update(
|
||||||
|
|
||||||
wallets = await get_watch_wallets(w.wallet.user, network["name"])
|
wallets = await get_watch_wallets(w.wallet.user, network["name"])
|
||||||
existing_wallet = next(
|
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:
|
if existing_wallet:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue