funding: disallow channel creation before lnd is synced to the chain

This commit adds a new restriction around funding channels at the
daemon level: lnd nodes will not allow either the initiation or the
acceptance of a channel before the node is fully synced to the best
known chain.

This fixes a class of bug that arises when a new node joins the network
and either attempts to open a channel or has a channel extended to them
before the node is fully synced to the network.
This commit is contained in:
Olaoluwa Osuntokun committed 2017-01-24 17:12:57 -08:00
1 parent 73d5daa2c3
commit a658fabf48
4 files changed
+60 -11

No files matched your search

+8 -3
View File
@@ -21,9 +21,14 @@ func (e ErrorCode) ToGrpcCode() codes.Code {
}
const (
// ErrorMaxPendingChannels is returned by remote peer when the number
// of active pending channels exceeds their maximum policy limit.
ErrorMaxPendingChannels ErrorCode = 1
// ErrMaxPendingChannels is returned by remote peer when the number of
// active pending channels exceeds their maximum policy limit.
ErrMaxPendingChannels ErrorCode = 1
// ErrSynchronizingChain is returned by a remote peer that receives a
// channel update or a funding request while their still syncing to the
// latest state of the blockchain.
ErrSynchronizingChain ErrorCode = 2
)
// ErrorGeneric represents a generic error bound to an exact channel. The