Skip to content

Commit

Permalink
Merge pull request #2777 from wpaulino/reject-zombie-anns
Browse files Browse the repository at this point in the history
channeldb+routing+discovery: reject zombie announcements
  • Loading branch information
Roasbeef authored Mar 28, 2019
2 parents fff003f + 5cec451 commit 43ba4a5
Show file tree
Hide file tree
Showing 10 changed files with 821 additions and 124 deletions.
3 changes: 3 additions & 0 deletions channeldb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ func createChannelDB(dbPath string) error {
if _, err := edges.CreateBucket(channelPointBucket); err != nil {
return err
}
if _, err := edges.CreateBucket(zombieBucket); err != nil {
return err
}

graphMeta, err := tx.CreateBucket(graphMetaBucket)
if err != nil {
Expand Down
9 changes: 8 additions & 1 deletion channeldb/error.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package channeldb

import "fmt"
import (
"errors"
"fmt"
)

var (
// ErrNoChanDBExists is returned when a channel bucket hasn't been
Expand Down Expand Up @@ -79,6 +82,10 @@ var (
// can't be found.
ErrEdgeNotFound = fmt.Errorf("edge not found")

// ErrZombieEdge is an error returned when we attempt to look up an edge
// but it is marked as a zombie within the zombie index.
ErrZombieEdge = errors.New("edge marked as zombie")

// ErrEdgeAlreadyExist is returned when edge with specific
// channel id can't be added because it already exist.
ErrEdgeAlreadyExist = fmt.Errorf("edge already exist")
Expand Down
Loading

0 comments on commit 43ba4a5

Please sign in to comment.