Fix a couple replicator nits (#4345)

automerge
This commit is contained in:
Michael Vines 2019-05-20 08:55:45 -07:00 committed by Grimes
parent 44ff25d044
commit 034eda4546
2 changed files with 5 additions and 8 deletions

View File

@ -137,7 +137,7 @@ fn create_request_processor(
let t_responder = responder("replicator-responder", storage_socket.clone(), r_responder); let t_responder = responder("replicator-responder", storage_socket.clone(), r_responder);
thread_handles.push(t_responder); thread_handles.push(t_responder);
let exit4 = exit.clone(); let exit = exit.clone();
let t_processor = spawn(move || loop { let t_processor = spawn(move || loop {
let packets = r_reader.recv_timeout(Duration::from_secs(1)); let packets = r_reader.recv_timeout(Duration::from_secs(1));
if let Ok(packets) = packets { if let Ok(packets) = packets {
@ -156,12 +156,11 @@ fn create_request_processor(
} }
} }
} }
if exit4.load(Ordering::Relaxed) { if exit.load(Ordering::Relaxed) {
break; break;
} }
}); });
thread_handles.push(t_processor); thread_handles.push(t_processor);
thread_handles thread_handles
} }
@ -425,13 +424,12 @@ impl Replicator {
let bal = client.poll_get_balance(&storage_keypair.pubkey()); let bal = client.poll_get_balance(&storage_keypair.pubkey());
if bal.is_err() || bal.unwrap() == 0 { if bal.is_err() || bal.unwrap() == 0 {
let (blockhash, _fee_calculator) = client.get_recent_blockhash().expect("blockhash"); let (blockhash, _fee_calculator) = client.get_recent_blockhash().expect("blockhash");
//TODO the account space needs to be well defined somewhere
let tx = system_transaction::create_account( let tx = system_transaction::create_account(
keypair, keypair,
&storage_keypair.pubkey(), &storage_keypair.pubkey(),
blockhash, blockhash,
1, 1,
1024 * 4, 1024 * 4, // TODO the account space needs to be well defined somewhere
&solana_storage_api::id(), &solana_storage_api::id(),
0, 0,
); );

View File

@ -245,12 +245,11 @@ impl StorageStage {
.get_account(&storage_keypair.pubkey()) .get_account(&storage_keypair.pubkey())
.is_none() .is_none()
{ {
// TODO the account space needs to be well defined somewhere
let create_instruction = system_instruction::create_account( let create_instruction = system_instruction::create_account(
&keypair.pubkey(), &keypair.pubkey(),
&storage_keypair.pubkey(), &storage_keypair.pubkey(),
1000, 1,
1024 * 4, 1024 * 4, // TODO the account space needs to be well defined somewhere
&solana_storage_api::id(), &solana_storage_api::id(),
); );
instructions.push(create_instruction); instructions.push(create_instruction);