derive clone for TransactionRecorder (#30876)

This commit is contained in:
Andrew Fitzgerald 2023-03-24 05:23:16 -07:00 committed by GitHub
parent f07b7ac49b
commit 230281f837
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 8 deletions

View File

@ -140,24 +140,17 @@ pub struct RecordTransactionsSummary {
pub starting_transaction_index: Option<usize>,
}
#[derive(Clone)]
pub struct TransactionRecorder {
// shared by all users of PohRecorder
pub record_sender: Sender<Record>,
pub is_exited: Arc<AtomicBool>,
}
impl Clone for TransactionRecorder {
fn clone(&self) -> Self {
TransactionRecorder::new(self.record_sender.clone(), self.is_exited.clone())
}
}
impl TransactionRecorder {
pub fn new(record_sender: Sender<Record>, is_exited: Arc<AtomicBool>) -> Self {
Self {
// shared
record_sender,
// shared
is_exited,
}
}