Simplify use of SendTransactionService (#10999)

* Send transaction upon recv

This will allow us to move the channel to the public interface

* Use a channel, not a method, to communicate

* Pipeline the services

* Ignore unused return values

* Fix clippy warning
This commit is contained in:
Greg Fitzgerald
2020-07-10 19:14:41 -06:00
committed by GitHub
parent 19813b0ab2
commit 145906123a
3 changed files with 87 additions and 102 deletions

View File

@@ -249,14 +249,7 @@ impl JsonRpcService {
));
let tpu_address = cluster_info.my_contact_info().tpu;
let exit_send_transaction_service = Arc::new(AtomicBool::new(false));
let send_transaction_service = Arc::new(SendTransactionService::new(
tpu_address,
&bank_forks,
&exit_send_transaction_service,
));
let request_processor = JsonRpcRequestProcessor::new(
let (request_processor, receiver) = JsonRpcRequestProcessor::new(
config,
bank_forks.clone(),
block_commitment_cache,
@@ -265,9 +258,16 @@ impl JsonRpcService {
health.clone(),
cluster_info,
genesis_hash,
send_transaction_service,
);
let exit_send_transaction_service = Arc::new(AtomicBool::new(false));
let _send_transaction_service = Arc::new(SendTransactionService::new(
tpu_address,
&bank_forks,
&exit_send_transaction_service,
receiver,
));
#[cfg(test)]
let test_request_processor = request_processor.clone();