mirror of
				https://github.com/0glabs/0g-storage-node.git
				synced 2025-11-04 08:37:27 +00:00 
			
		
		
		
	unnecessary loop
This commit is contained in:
		
							parent
							
								
									ce9977ff29
								
							
						
					
					
						commit
						00a0d9499d
					
				@ -273,7 +273,7 @@ impl LogStoreWrite for LogManager {
 | 
				
			|||||||
                bail!("unexpected tx!");
 | 
					                bail!("unexpected tx!");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        let same_data_tx_seqs = self.tx_store.put_tx(tx.clone())?;
 | 
					        let maybe_same_data_tx_seq = self.tx_store.put_tx(tx.clone())?.first().cloned();
 | 
				
			||||||
        // TODO(zz): Should we validate received tx?
 | 
					        // TODO(zz): Should we validate received tx?
 | 
				
			||||||
        self.append_subtree_list(
 | 
					        self.append_subtree_list(
 | 
				
			||||||
            tx.seq,
 | 
					            tx.seq,
 | 
				
			||||||
@ -289,11 +289,10 @@ impl LogStoreWrite for LogManager {
 | 
				
			|||||||
        // Drop the lock because `copy_tx_data` will lock again.
 | 
					        // Drop the lock because `copy_tx_data` will lock again.
 | 
				
			||||||
        drop(merkle);
 | 
					        drop(merkle);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for old_tx_seq in same_data_tx_seqs {
 | 
					        if let Some(old_tx_seq) = maybe_same_data_tx_seq {
 | 
				
			||||||
            if self.check_tx_completed(old_tx_seq)? {
 | 
					            if self.check_tx_completed(old_tx_seq)? {
 | 
				
			||||||
                // copy and finalize once, then stop
 | 
					                // copy and finalize once, then stop
 | 
				
			||||||
                self.copy_tx_and_finalize(old_tx_seq, vec![tx.seq])?;
 | 
					                self.copy_tx_and_finalize(old_tx_seq, vec![tx.seq])?;
 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        metrics::PUT_TX.update_since(start_time);
 | 
					        metrics::PUT_TX.update_since(start_time);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user