diff --git a/backend/stakepoold/rpc/rpcserver/context.go b/backend/stakepoold/rpc/rpcserver/context.go index f8e37d9b..ea05f41f 100644 --- a/backend/stakepoold/rpc/rpcserver/context.go +++ b/backend/stakepoold/rpc/rpcserver/context.go @@ -423,14 +423,10 @@ func (ctx *AppContext) MyMasterPubKeys() (map[string]string, error) { } key, err := ctx.WalletConnection.GetMasterPubkey(acct, ctx.Params) if err != nil { - log.Errorf("MyMasterPubKeys: GetMasterPubKey rpc failed: %v", err) - continue + return nil, fmt.Errorf("MyMasterPubKeys: GetMasterPubKey rpc failed: %v", err) } keyMap[acct] = key.String() } - if len(keyMap) == 0 { - return nil, errors.New("MyMasterPubKeys: found no master extended public keys") - } return keyMap, nil } diff --git a/stakepooldclient/stakepooldclient.go b/stakepooldclient/stakepooldclient.go index 698e1b3a..49949c33 100644 --- a/stakepooldclient/stakepooldclient.go +++ b/stakepooldclient/stakepooldclient.go @@ -500,16 +500,15 @@ func (s *StakepooldManager) RPCStatus() []string { } // MyMasterPubKeys performs gRPC MasterPubKeys requests against all stakepoold -// instances and returns all results fetched without errors. Returns a map of keys -// to accounts or an error if no keys were found. +// instances and returns a map of keys to accounts or an error if any +// of the gRPC calls failed func (s *StakepooldManager) MyMasterPubKeys() (map[string]string, error) { pubKeyMap := make(map[string]string) for i, conn := range s.grpcConnections { client := pb.NewStakepooldServiceClient(conn) resp, err := client.MyMasterPubKeys(context.Background(), &pb.MyMasterPubKeysRequest{}) if err != nil { - log.Warnf("GetMasterPubkeys gRPC failed on stakepoold instance %d: %v", i, err) - continue + return nil, fmt.Errorf("GetMasterPubkeys gRPC failed on stakepoold instance %d: %v", i, err) } for _, pubKey := range resp.MasterPubKeys { // all public keys for the default account must be the same @@ -519,9 +518,6 @@ func (s *StakepooldManager) MyMasterPubKeys() (map[string]string, error) { pubKeyMap[pubKey.Account] = pubKey.PubKey } } - if len(pubKeyMap) == 0 { - return nil, errors.New("found no master extended public keys on any stakepoold instances") - } for k, v := range pubKeyMap { log.Infof("found master extended pubkey %s for account \"%s\"", v, k) }