Skip to content

Commit f2014f1

Browse files
committed
remove empty by_out_point entry
Signed-off-by: Eval EXEC <execvy@gmail.com>
1 parent 3983816 commit f2014f1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tx-pool/src/component/orphan.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,13 @@ impl OrphanPool {
7575
self.entries.remove(id).map(|entry| {
7676
debug!("remove orphan tx {}", entry.tx.hash());
7777
for out_point in entry.tx.input_pts_iter() {
78-
self.by_out_point
79-
.get_mut(&out_point)
80-
.map(|set| set.remove(id));
78+
if let Some(ids_set) = self.by_out_point.get_mut(&out_point) {
79+
ids_set.remove(id);
80+
81+
if ids_set.is_empty() {
82+
self.by_out_point.remove(&out_point);
83+
}
84+
}
8185
}
8286
entry
8387
})

0 commit comments

Comments
 (0)