mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-01 11:00:51 +02:00
multi: comprehensive typo fixes across all packages
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
72a5bc8648
commit
a93736d21e
@ -26,17 +26,17 @@ type ValidationBarrier struct {
|
||||
// dependants.
|
||||
chanAnnFinSignal map[lnwire.ShortChannelID]chan struct{}
|
||||
|
||||
// chanEdgeDependancies tracks any channel edge updates which should
|
||||
// chanEdgeDependencies tracks any channel edge updates which should
|
||||
// wait until the completion of the ChannelAnnouncement before
|
||||
// proceeding. This is a dependency, as we can't validate the update
|
||||
// before we validate the announcement which creates the channel
|
||||
// itself.
|
||||
chanEdgeDependancies map[lnwire.ShortChannelID]chan struct{}
|
||||
chanEdgeDependencies map[lnwire.ShortChannelID]chan struct{}
|
||||
|
||||
// nodeAnnDependancies tracks any pending NodeAnnouncement validation
|
||||
// nodeAnnDependencies tracks any pending NodeAnnouncement validation
|
||||
// jobs which should wait until the completion of the
|
||||
// ChannelAnnouncement before proceeding.
|
||||
nodeAnnDependancies map[Vertex]chan struct{}
|
||||
nodeAnnDependencies map[Vertex]chan struct{}
|
||||
|
||||
quit chan struct{}
|
||||
sync.Mutex
|
||||
@ -50,8 +50,8 @@ func NewValidationBarrier(numActiveReqs int,
|
||||
|
||||
v := &ValidationBarrier{
|
||||
chanAnnFinSignal: make(map[lnwire.ShortChannelID]chan struct{}),
|
||||
chanEdgeDependancies: make(map[lnwire.ShortChannelID]chan struct{}),
|
||||
nodeAnnDependancies: make(map[Vertex]chan struct{}),
|
||||
chanEdgeDependencies: make(map[lnwire.ShortChannelID]chan struct{}),
|
||||
nodeAnnDependencies: make(map[Vertex]chan struct{}),
|
||||
quit: quitChan,
|
||||
}
|
||||
|
||||
@ -65,9 +65,9 @@ func NewValidationBarrier(numActiveReqs int,
|
||||
return v
|
||||
}
|
||||
|
||||
// InitJobDependancies will wait for a new job slot to become open, and then
|
||||
// sets up any dependant signals/trigger for the new job
|
||||
func (v *ValidationBarrier) InitJobDependancies(job interface{}) {
|
||||
// InitJobDependencies will wait for a new job slot to become open, and then
|
||||
// sets up any dependent signals/trigger for the new job
|
||||
func (v *ValidationBarrier) InitJobDependencies(job interface{}) {
|
||||
// We'll wait for either a new slot to become open, or for the quit
|
||||
// channel to be closed.
|
||||
select {
|
||||
@ -79,7 +79,7 @@ func (v *ValidationBarrier) InitJobDependancies(job interface{}) {
|
||||
defer v.Unlock()
|
||||
|
||||
// Once a slot is open, we'll examine the message of the job, to see if
|
||||
// there need to be any dependant barriers set up.
|
||||
// there need to be any dependent barriers set up.
|
||||
switch msg := job.(type) {
|
||||
|
||||
// If this is a channel announcement, then we'll need to set up den
|
||||
@ -93,7 +93,7 @@ func (v *ValidationBarrier) InitJobDependancies(job interface{}) {
|
||||
// one doesn't already exist, as there may be duplicate
|
||||
// announcements. We'll close this signal once the
|
||||
// ChannelAnnouncement has been validated. This will result in
|
||||
// all the dependant jobs being unlocked so they can finish
|
||||
// all the dependent jobs being unlocked so they can finish
|
||||
// execution themselves.
|
||||
if _, ok := v.chanAnnFinSignal[msg.ShortChannelID]; !ok {
|
||||
// We'll create the channel that we close after we
|
||||
@ -102,10 +102,10 @@ func (v *ValidationBarrier) InitJobDependancies(job interface{}) {
|
||||
// at the same time.
|
||||
annFinCond := make(chan struct{})
|
||||
v.chanAnnFinSignal[msg.ShortChannelID] = annFinCond
|
||||
v.chanEdgeDependancies[msg.ShortChannelID] = annFinCond
|
||||
v.chanEdgeDependencies[msg.ShortChannelID] = annFinCond
|
||||
|
||||
v.nodeAnnDependancies[NewVertex(msg.NodeID1)] = annFinCond
|
||||
v.nodeAnnDependancies[NewVertex(msg.NodeID2)] = annFinCond
|
||||
v.nodeAnnDependencies[NewVertex(msg.NodeID1)] = annFinCond
|
||||
v.nodeAnnDependencies[NewVertex(msg.NodeID2)] = annFinCond
|
||||
}
|
||||
case *channeldb.ChannelEdgeInfo:
|
||||
|
||||
@ -114,10 +114,10 @@ func (v *ValidationBarrier) InitJobDependancies(job interface{}) {
|
||||
annFinCond := make(chan struct{})
|
||||
|
||||
v.chanAnnFinSignal[shortID] = annFinCond
|
||||
v.chanEdgeDependancies[shortID] = annFinCond
|
||||
v.chanEdgeDependencies[shortID] = annFinCond
|
||||
|
||||
v.nodeAnnDependancies[NewVertex(msg.NodeKey1)] = annFinCond
|
||||
v.nodeAnnDependancies[NewVertex(msg.NodeKey2)] = annFinCond
|
||||
v.nodeAnnDependencies[NewVertex(msg.NodeKey1)] = annFinCond
|
||||
v.nodeAnnDependencies[NewVertex(msg.NodeKey2)] = annFinCond
|
||||
}
|
||||
|
||||
// These other types don't have any dependants, so no further
|
||||
@ -149,8 +149,8 @@ func (v *ValidationBarrier) CompleteJob() {
|
||||
|
||||
// WaitForDependants will block until any jobs that this job dependants on have
|
||||
// finished executing. This allows us a graceful way to schedule goroutines
|
||||
// based on any pending uncompleted dependant jobs. If this job doesn't have an
|
||||
// active dependant, then this function will return immediately.
|
||||
// based on any pending uncompleted dependent jobs. If this job doesn't have an
|
||||
// active dependent, then this function will return immediately.
|
||||
func (v *ValidationBarrier) WaitForDependants(job interface{}) {
|
||||
|
||||
var (
|
||||
@ -165,15 +165,15 @@ func (v *ValidationBarrier) WaitForDependants(job interface{}) {
|
||||
// completion of any active ChannelAnnouncement jobs related to them.
|
||||
case *channeldb.ChannelEdgePolicy:
|
||||
shortID := lnwire.NewShortChanIDFromInt(msg.ChannelID)
|
||||
signal, ok = v.chanEdgeDependancies[shortID]
|
||||
signal, ok = v.chanEdgeDependencies[shortID]
|
||||
case *channeldb.LightningNode:
|
||||
vertex := NewVertex(msg.PubKey)
|
||||
signal, ok = v.nodeAnnDependancies[vertex]
|
||||
signal, ok = v.nodeAnnDependencies[vertex]
|
||||
case *lnwire.ChannelUpdate:
|
||||
signal, ok = v.chanEdgeDependancies[msg.ShortChannelID]
|
||||
signal, ok = v.chanEdgeDependencies[msg.ShortChannelID]
|
||||
case *lnwire.NodeAnnouncement:
|
||||
vertex := NewVertex(msg.NodeID)
|
||||
signal, ok = v.nodeAnnDependancies[vertex]
|
||||
signal, ok = v.nodeAnnDependencies[vertex]
|
||||
|
||||
// Other types of jobs can be executed immediately, so we'll just
|
||||
// return directly.
|
||||
@ -201,7 +201,7 @@ func (v *ValidationBarrier) WaitForDependants(job interface{}) {
|
||||
}
|
||||
}
|
||||
|
||||
// SignalDependants will signal any jobs that are dependant on this job that
|
||||
// SignalDependants will signal any jobs that are dependent on this job that
|
||||
// they can continue execution. If the job doesn't have any dependants, then
|
||||
// this function sill exit immediately.
|
||||
func (v *ValidationBarrier) SignalDependants(job interface{}) {
|
||||
@ -212,7 +212,7 @@ func (v *ValidationBarrier) SignalDependants(job interface{}) {
|
||||
|
||||
// If we've just finished executing a ChannelAnnouncement, then we'll
|
||||
// close out the signal, and remove the signal from the map of active
|
||||
// ones. This will allow any dependant jobs to continue execution.
|
||||
// ones. This will allow any dependent jobs to continue execution.
|
||||
case *channeldb.ChannelEdgeInfo:
|
||||
shortID := lnwire.NewShortChanIDFromInt(msg.ChannelID)
|
||||
finSignal, ok := v.chanAnnFinSignal[shortID]
|
||||
@ -227,20 +227,20 @@ func (v *ValidationBarrier) SignalDependants(job interface{}) {
|
||||
delete(v.chanAnnFinSignal, msg.ShortChannelID)
|
||||
}
|
||||
|
||||
delete(v.chanEdgeDependancies, msg.ShortChannelID)
|
||||
delete(v.chanEdgeDependencies, msg.ShortChannelID)
|
||||
|
||||
// For all other job types, we'll delete the tracking entries from the
|
||||
// map, as if we reach this point, then all dependants have already
|
||||
// finished executing and we can proceed.
|
||||
case *channeldb.LightningNode:
|
||||
delete(v.nodeAnnDependancies, NewVertex(msg.PubKey))
|
||||
delete(v.nodeAnnDependencies, NewVertex(msg.PubKey))
|
||||
case *lnwire.NodeAnnouncement:
|
||||
delete(v.nodeAnnDependancies, NewVertex(msg.NodeID))
|
||||
delete(v.nodeAnnDependencies, NewVertex(msg.NodeID))
|
||||
case *lnwire.ChannelUpdate:
|
||||
delete(v.chanEdgeDependancies, msg.ShortChannelID)
|
||||
delete(v.chanEdgeDependencies, msg.ShortChannelID)
|
||||
case *channeldb.ChannelEdgePolicy:
|
||||
shortID := lnwire.NewShortChanIDFromInt(msg.ChannelID)
|
||||
delete(v.chanEdgeDependancies, shortID)
|
||||
delete(v.chanEdgeDependencies, shortID)
|
||||
|
||||
case *lnwire.AnnounceSignatures:
|
||||
return
|
||||
|
Reference in New Issue
Block a user