channeldb: refactor syncPending to expose new syncNewChannel function

The new syncNewChannel function will allow callers to insert a new
channel given the OpenChannel struct, and set of addresses for the
channel peer. This new method will also create a new LinkNode for the
peer if one doesn't already exist.
This commit is contained in:
Olaoluwa Osuntokun
2018-12-09 19:28:54 -08:00
parent 7a88f580ea
commit 11c6887ffa
2 changed files with 44 additions and 30 deletions

View File

@@ -103,6 +103,11 @@ var (
// indicate it should be.
ErrEdgePolicyOptionalFieldNotFound = fmt.Errorf("optional field not " +
"present")
// ErrChanAlreadyExists is return when the caller attempts to create a
// channel with a channel point that is already present in the
// database.
ErrChanAlreadyExists = fmt.Errorf("channel already exists")
)
// ErrTooManyExtraOpaqueBytes creates an error which should be returned if the