fabianbormann / cardano-peer-connect

This library aims to provide simple interfaces to implement CIP-0045 for dApps and wallets
Apache License 2.0
11 stars 4 forks source link

Fix: Do not keep multiple meerkat instances for same connection #44

Closed marcuspuchalla closed 1 year ago

marcuspuchalla commented 1 year ago

When a wallet tries to connect multiple times to a DApp, multiple meerkat instances are added to the CardanoPeerConnect instance.

To only keep one instance for a given connection at a time, I propose we change the meerkats property to a Map. When adding a new connection, we look up if there is an old instance, close the old instance and add the new one.

This improves the reliability of connecting DApp and wallets.