Skip to content

Commit

Permalink
chore: skip key when nil
Browse files Browse the repository at this point in the history
  • Loading branch information
kasteph committed Nov 7, 2024
1 parent d424936 commit 762ea51
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@ func (db *KeysDB) writeKeysToFile(keysTrie *trie.Trie[bit256.Key, crypto.PrivKey

func integrateKeysIntoTrie(keysTrie *trie.Trie[bit256.Key, crypto.PrivKey], keys []crypto.PrivKey) {
for _, key := range keys {
if key == nil {
logger.Warn("skipping nil key")
continue
}

pid, err := peer.IDFromPrivateKey(key)

if err != nil {
logger.Warnf("Error getting peer ID: %v", err)
continue
Expand Down

0 comments on commit 762ea51

Please sign in to comment.