Don't require a cluster to query for one's own pubkey
This commit is contained in:
parent
9dd0a6e6a7
commit
23846bcf1c
|
@ -313,6 +313,12 @@ pub fn parse_command(
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn process_command(config: &WalletConfig) -> Result<String, Box<error::Error>> {
|
pub fn process_command(config: &WalletConfig) -> Result<String, Box<error::Error>> {
|
||||||
|
match config.command {
|
||||||
|
// Get address of this client
|
||||||
|
WalletCommand::Address => return Ok(format!("{}", config.id.pubkey())),
|
||||||
|
_ => (),
|
||||||
|
}
|
||||||
|
|
||||||
let leader = poll_gossip_for_leader(config.network, config.timeout)?;
|
let leader = poll_gossip_for_leader(config.network, config.timeout)?;
|
||||||
let tpu_addr = leader.contact_info.tpu;
|
let tpu_addr = leader.contact_info.tpu;
|
||||||
let drone_addr = config.drone_addr(tpu_addr);
|
let drone_addr = config.drone_addr(tpu_addr);
|
||||||
|
@ -320,7 +326,7 @@ pub fn process_command(config: &WalletConfig) -> Result<String, Box<error::Error
|
||||||
|
|
||||||
match config.command {
|
match config.command {
|
||||||
// Get address of this client
|
// Get address of this client
|
||||||
WalletCommand::Address => Ok(format!("{}", config.id.pubkey())),
|
WalletCommand::Address => unreachable!(),
|
||||||
// Request an airdrop from Solana Drone;
|
// Request an airdrop from Solana Drone;
|
||||||
WalletCommand::AirDrop(tokens) => {
|
WalletCommand::AirDrop(tokens) => {
|
||||||
println!(
|
println!(
|
||||||
|
|
Loading…
Reference in New Issue