Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

channeldb+routing+discovery: reject zombie announcements #2777

Merged
merged 8 commits into from
Mar 28, 2019
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