Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 74b2c92

Browse files
authored
fix(in_mem): fix the clone logic (#14038)
1 parent de80d01 commit 74b2c92

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

client/api/src/in_mem.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ struct BlockchainStorage<Block: BlockT> {
114114
}
115115

116116
/// In-memory blockchain. Supports concurrent reads.
117+
#[derive(Clone)]
117118
pub struct Blockchain<Block: BlockT> {
118119
storage: Arc<RwLock<BlockchainStorage<Block>>>,
119120
}
@@ -124,13 +125,6 @@ impl<Block: BlockT> Default for Blockchain<Block> {
124125
}
125126
}
126127

127-
impl<Block: BlockT + Clone> Clone for Blockchain<Block> {
128-
fn clone(&self) -> Self {
129-
let storage = Arc::new(RwLock::new(self.storage.read().clone()));
130-
Blockchain { storage }
131-
}
132-
}
133-
134128
impl<Block: BlockT> Blockchain<Block> {
135129
/// Get header hash of given block.
136130
pub fn id(&self, id: BlockId<Block>) -> Option<Block::Hash> {

0 commit comments

Comments
 (0)