app/scripts/keyring-controller.js
// Persists a nickname equal to `label` for the specified account.
Persists a nickname equal to `label` for the specified account.
Persists a nickname equal to ` label ` for the specified account .
saveAccountLabel (account, label) {
    try {
      const hexAddress = normalizeAddress(account)
      const state = this.store.getState()
      const walletNicknames = state.walletNicknames || {}
      walletNicknames[hexAddress] = label
      this.store.updateState({ walletNicknames })
      const identities = this.memStore.getState().identities
      identities[hexAddress].name = label
      this.memStore.updateState({ identities })
      return Promise.resolve(label)
    } catch (err) {
      return Promise.reject(err)
    }
  }
saveAccountLabel ( account , label ) { try { const hexAddress = normalizeAddress ( account ) const state = this . store . getState ( ) const walletNicknames = state . walletNicknames || { } walletNicknames [ hexAddress ] = label this . store . updateState ( { walletNicknames } ) const identities = this . memStore . getState ( ) . identities identities [ hexAddress ] . name = label this . memStore . updateState ( { identities } ) return Promise . resolve ( label ) } catch ( err ) { return Promise . reject ( err ) } }
Persists a nickname equal to `label` for the specified account.
Persists a nickname equal to ` label ` for the specified account .
// update state on diskStore // update state on memStore