From 0e749dad4c15c61feb158f6f3912123db9445596 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Mon, 12 Nov 2018 12:39:42 -0700 Subject: [PATCH] Use cluster_info to get rpc address --- src/bin/wallet.rs | 14 -------------- src/wallet.rs | 8 ++------ 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/bin/wallet.rs b/src/bin/wallet.rs index f56b2568e2..31bd93bcd8 100644 --- a/src/bin/wallet.rs +++ b/src/bin/wallet.rs @@ -6,7 +6,6 @@ extern crate solana; use clap::{App, Arg, ArgMatches, SubCommand}; use solana::logger; -use solana::rpc::RPC_PORT; use solana::signature::{read_keypair, KeypairUtil}; use solana::wallet::{gen_keypair_file, parse_command, process_command, WalletConfig, WalletError}; use std::error; @@ -30,12 +29,6 @@ pub fn parse_args(matches: &ArgMatches) -> Result Result Result<(), Box> { .value_name("SECS") .takes_value(true) .help("Max seconds to wait to get necessary gossip from the network"), - ).arg( - Arg::with_name("rpc-port") - .long("port") - .takes_value(true) - .value_name("NUM") - .help("Optional rpc-port configuration to connect to non-default nodes") ).arg( Arg::with_name("proxy") .long("proxy") diff --git a/src/wallet.rs b/src/wallet.rs index 5060e62fa9..de30e086c0 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -87,7 +87,6 @@ pub struct WalletConfig { pub network: SocketAddr, pub timeout: Option, pub proxy: Option, - pub rpc_port: u16, } impl Default for WalletConfig { @@ -99,7 +98,6 @@ impl Default for WalletConfig { network: default_addr, timeout: None, proxy: None, - rpc_port: 0, } } } @@ -111,9 +109,7 @@ impl WalletConfig { drone_addr } - pub fn rpc_addr(&self, tpu_addr: SocketAddr) -> String { - let mut rpc_addr = tpu_addr; - rpc_addr.set_port(self.rpc_port); + pub fn rpc_addr(&self, rpc_addr: SocketAddr) -> String { let rpc_addr_str = format!("http://{}", rpc_addr.to_string()); self.proxy.clone().unwrap_or(rpc_addr_str) } @@ -319,7 +315,7 @@ pub fn process_command(config: &WalletConfig) -> Result