Skip to content

Commit

Permalink
Don't cache local keys by the cache keyring. (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitryhil authored Mar 7, 2024
1 parent 85e22fa commit 7bb6852
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions relayer/cmd/cli/keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ func (ck *cacheKeyring) MigrateAll() ([]*keyring.Record, error) {
}

func (ck *cacheKeyring) cacheKey(keyInfo *keyring.Record) error {
// If the local is nil, the `ExportPrivKeyArmor` will return `keyring.ErrPrivKeyExtr`.
// Usually it happens to the imported keys with the public key only, that's why we don't cache such keys.
if keyInfo.GetLocal() == nil {
return nil
}

pass := uuid.NewString()
armor, err := ck.parentKeyring.ExportPrivKeyArmor(keyInfo.Name, pass)
if err != nil {
Expand Down

0 comments on commit 7bb6852

Please sign in to comment.