Skip to content

Commit

Permalink
Longest prefix on Transaction (#5)
Browse files Browse the repository at this point in the history
* reverse iterator init

* some fixes

* fix reverse iterator seaklowerbound

* fix tests

* fix track channels

* longest prefix on txn
  • Loading branch information
absolutelightning authored May 20, 2024
1 parent 41d4a36 commit 0a505a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ func (t *Txn[T]) slowNotify() {
}
}

func (t *Txn[T]) LongestPrefix(prefix []byte) ([]byte, T, bool) {
return t.tree.LongestPrefix(prefix)
}

// DeletePrefix is used to delete an entire subtree that matches the prefix
// This will delete all nodes under that prefix
func (t *Txn[T]) DeletePrefix(prefix []byte) bool {
Expand Down

0 comments on commit 0a505a5

Please sign in to comment.