diff --git a/routes/global_state.go b/routes/global_state.go index c478695c..37668e80 100644 --- a/routes/global_state.go +++ b/routes/global_state.go @@ -980,6 +980,8 @@ func (gs *GlobalState) Get(key []byte) (value []byte, _err error) { err := gs.GlobalStateDB.View(func(txn *badger.Txn) error { item, err := txn.Get(key) if err != nil { + // Todo: I think this error needs to be processed. It could be a key not found error, then nil should be returned. + // If it's another error, it should be returned. return nil } retValue, err = item.ValueCopy(nil) diff --git a/routes/shared.go b/routes/shared.go index c050007c..8490900a 100644 --- a/routes/shared.go +++ b/routes/shared.go @@ -259,18 +259,8 @@ func (fes *APIServer) GetVerifiedUsernameToPKIDMapFromGlobalState() (_verificati return nil, fmt.Errorf("GetVerifiedUsernameToPKIDMapFromGlobalState: Cannot Decode Verification Map: %v", err) } } else { - // Create the inital map structure + // Return an empty map structure verifiedMapStruct.VerifiedUsernameToPKID = make(map[string]*lib.PKID) - - // Encode the map and stick it in the database. - metadataDataBuf := bytes.NewBuffer([]byte{}) - if err = gob.NewEncoder(metadataDataBuf).Encode(verifiedMapStruct); err != nil { - return nil, fmt.Errorf("GetVerifiedUsernameToPKIDMapFromGlobalState: cannot encode verifiedMap struct: %v", err) - } - err = fes.GlobalState.Put(_GlobalStatePrefixForVerifiedMap, metadataDataBuf.Bytes()) - if err != nil { - return nil, fmt.Errorf("GetVerifiedUsernameToPKIDMapFromGlobalState: Cannot Decode Verification Map: %v", err) - } } // Return the verificationMap return verifiedMapStruct.VerifiedUsernameToPKID, nil