async fn complete_send_transaction_protocol(
        &mut self,
        join_result: Result<u64, TransactionServiceProtocolError>,
        transaction_broadcast_join_handles: &mut FuturesUnordered<
            JoinHandle<Result<u64, TransactionServiceProtocolError>>,
        >,
    )
    {
        match join_result {
            Ok(id) => {
                let _ = self.pending_transaction_reply_senders.remove(&id);
                let _ = self.send_transaction_cancellation_senders.remove(&id);
                let _ = self
                    .broadcast_completed_transaction_to_mempool(id, transaction_broadcast_join_handles)
                    .await
                    .map_err(|resp| {
                        error!(
                            target: LOG_TARGET,
                            "Error starting Broadcast Protocol after completed Send Transaction Protocol : {:?}", resp
                        );
                        resp
                    });
                trace!(
                    target: LOG_TARGET,
                    "Send Transaction Protocol for TxId: {} completed successfully",
                    id
                );
            },
            Err(TransactionServiceProtocolError { id, error }) => {
                let _ = self.pending_transaction_reply_senders.remove(&id);
                let _ = self.send_transaction_cancellation_senders.remove(&id);
                if let TransactionServiceError::Shutdown = error {
                    return;
                }
                warn!(
                    target: LOG_TARGET,
                    "Error completing Send Transaction Protocol (Id: {}): {:?}", id, error
                );
                let _ = self
                    .event_publisher
                    .send(Arc::new(TransactionEvent::Error(format!("{:?}", error))));
            },
        }
    }
/// Handle the final clean up after a Send Transaction protocol completes
Handle the final clean up after a Send Transaction protocol completes
Handle the final clean up after a Send Transaction protocol completes
async fn complete_send_transaction_protocol(
        &mut self,
        join_result: Result<u64, TransactionServiceProtocolError>,
        transaction_broadcast_join_handles: &mut FuturesUnordered<
            JoinHandle<Result<u64, TransactionServiceProtocolError>>,
        >,
    )
    {
        match join_result {
            Ok(id) => {
                let _ = self.pending_transaction_reply_senders.remove(&id);
                let _ = self.send_transaction_cancellation_senders.remove(&id);
                let _ = self
                    .broadcast_completed_transaction_to_mempool(id, transaction_broadcast_join_handles)
                    .await
                    .map_err(|resp| {
                        error!(
                            target: LOG_TARGET,
                            "Error starting Broadcast Protocol after completed Send Transaction Protocol : {:?}", resp
                        );
                        resp
                    });
                trace!(
                    target: LOG_TARGET,
                    "Send Transaction Protocol for TxId: {} completed successfully",
                    id
                );
            },
            Err(TransactionServiceProtocolError { id, error }) => {
                let _ = self.pending_transaction_reply_senders.remove(&id);
                let _ = self.send_transaction_cancellation_senders.remove(&id);
                if let TransactionServiceError::Shutdown = error {
                    return;
                }
                warn!(
                    target: LOG_TARGET,
                    "Error completing Send Transaction Protocol (Id: {}): {:?}", id, error
                );
                let _ = self
                    .event_publisher
                    .send(Arc::new(TransactionEvent::Error(format!("{:?}", error))));
            },
        }
    }
async fn complete_send_transaction_protocol ( & mut self , join_result : Result < u64 , TransactionServiceProtocolError > , transaction_broadcast_join_handles : & mut FuturesUnordered < JoinHandle < Result < u64 , TransactionServiceProtocolError > > , > , ) { match join_result { Ok ( id ) => { let _ = self . pending_transaction_reply_senders . remove ( & id ) ; let _ = self . send_transaction_cancellation_senders . remove ( & id ) ; let _ = self . broadcast_completed_transaction_to_mempool ( id , transaction_broadcast_join_handles ) . await . map_err ( | resp | { error ! ( target LOG_TARGET " " resp ) ; resp } ) ; trace ! ( target LOG_TARGET " " id ) ; } , Err ( TransactionServiceProtocolError { id , error } ) => { let _ = self . pending_transaction_reply_senders . remove ( & id ) ; let _ = self . send_transaction_cancellation_senders . remove ( & id ) ; if let TransactionServiceError :: Shutdown = error { return ; } warn ! ( target LOG_TARGET " " id error ) ; let _ = self . event_publisher . send ( Arc :: new ( TransactionEvent :: Error ( format ! ( " " error ) ) ) ) ; } , } }
Handle the final clean up after a Send Transaction protocol completes
Handle the final clean up after a Send Transaction protocol completes
&mut self
join_result
Result<u64, TransactionServiceProtocolError>
transaction_broadcast_join_handles
&mut FuturesUnordered<
            JoinHandle<Result<u64, TransactionServiceProtocolError>>,
        >
&mut self
join_result
Result<u64, TransactionServiceProtocolError>
transaction_broadcast_join_handles
&mut FuturesUnordered<
            JoinHandle<Result<u64, TransactionServiceProtocolError>>,
        >