commerceblock / mercury

An implementation of statechains
GNU General Public License v3.0
78 stars 12 forks source link

Fix client error not recognizing own SE address #422

Closed ssantos21 closed 1 year ago

ssantos21 commented 1 year ago

SE addresses are generated in the get_new_state_entity_address function, which gets a new key from se_proof_keys.

This new address is added to se_backup_keys via the add_address function. This function adds the new key in addresses_derivation_map, but apparently the manually added items in this one don't persist.

When the wallet is loaded, the keys of se_backup_keys are fully derivation generated and there is no way to get the keys added manually.

This way, if the client generates an SE address and then restarts, it can no longer receive through that address.

This PR suggests a workaround for this problem. Instead of looking in se_backup_keys, it looks for the key directly in se_proof_keys, which is the derivation in which the key was generated.

ssantos21 commented 1 year ago

Closing in favor of https://github.com/commerceblock/mercury/pull/424