fabianbormann / cardano-peer-connect

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

fix: Close old meerkat for same connection id #45

Closed marcuspuchalla closed 1 year ago

marcuspuchalla commented 1 year ago

tl;dr This fixes https://github.com/fabianbormann/cardano-peer-connect/issues/44


If a wallet calls connect multiple times, the list of meerkat connections clumped, even though all meerkats are for the same connection.

This commit add the option to only allow a single meerkat instance for a given identifier to exist. If a new one is created, the old one will be closed and removed.

This also fixes a small but from last commit where wallet address was not given to verify connect, which broke the autoconnect management.