-
Notifications
You must be signed in to change notification settings - Fork 0
Description
ecdsa_pub_key_addresses and utxos_state_addresses of the BitcoinAgent are already manageable with add_address_with_parameters, add_address, remove_address and list_addresses.
However for caches required for transfer, update_transaction and transaction_status, we need some functions to clean them. The canister developer can already by using get_state and from_state modify them but we want to provide a clean way to do this. We could for instance propose a function cleaning caches entries older than a given number of confirmations.
Even if there will already be some auto-cleanup, for instance let say we have a cache with the time when we sent a transaction to support transaction_status. Once the transaction was confirmed in a block, then we can remove it from this cache because we don’t anymore have to check for time out.
We have to take care when cleaning not to invalidate assumptions that we do when manipulating these caches otherwise the BitcoinAgent's memory would end up corrupted.