Skip to content

Commit

Permalink
remove empty by_out_point entry
Browse files Browse the repository at this point in the history
Signed-off-by: Eval EXEC <execvy@gmail.com>
  • Loading branch information
eval-exec committed Oct 15, 2024
1 parent 3983816 commit 4baad1b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tx-pool/src/component/orphan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,13 @@ impl OrphanPool {
self.entries.remove(id).map(|entry| {
debug!("remove orphan tx {}", entry.tx.hash());
for out_point in entry.tx.input_pts_iter() {
self.by_out_point
.get_mut(&out_point)
.map(|set| set.remove(id));
self.by_out_point.get_mut(&out_point).map(|set| {
set.remove(id);
// remove empty by_out_point entry
if set.is_empty() {
self.by_out_point.remove(&out_point);
}
});
}
entry
})
Expand Down

0 comments on commit 4baad1b

Please sign in to comment.