From cbdd16b3ceb359f13ef3048c0cc6e819b1261c63 Mon Sep 17 00:00:00 2001 From: yjhmelody Date: Fri, 28 Apr 2023 12:17:44 +0800 Subject: [PATCH] fix(in_mem): fix the clone logic --- client/api/src/in_mem.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/client/api/src/in_mem.rs b/client/api/src/in_mem.rs index 27a74ddd79ed6..0a29a4dbaae5c 100644 --- a/client/api/src/in_mem.rs +++ b/client/api/src/in_mem.rs @@ -114,6 +114,7 @@ struct BlockchainStorage { } /// In-memory blockchain. Supports concurrent reads. +#[derive(Clone)] pub struct Blockchain { storage: Arc>>, } @@ -124,13 +125,6 @@ impl Default for Blockchain { } } -impl Clone for Blockchain { - fn clone(&self) -> Self { - let storage = Arc::new(RwLock::new(self.storage.read().clone())); - Blockchain { storage } - } -} - impl Blockchain { /// Get header hash of given block. pub fn id(&self, id: BlockId) -> Option {