multi: comprehensive typo fixes across all packages
This commit is contained in:
1 parent
72a5bc8648
commit
a93736d21e
103 files changed
+435
-435
No files matched your search
@@ -18,7 +18,7 @@ import (
|
||||
)
|
||||
|
||||
// NetworkPeerBootstrapper is an interface that represents an initial peer
|
||||
// boostrap mechanism. This interface is to be used to bootstrap a new peer to
|
||||
// bootstrap mechanism. This interface is to be used to bootstrap a new peer to
|
||||
// the connection by providing it with the pubkey+address of a set of existing
|
||||
// peers on the network. Several bootstrap mechanisms can be implemented such
|
||||
// as DNS, in channel graph, DHT's, etc.
|
||||
@@ -48,7 +48,7 @@ func MultiSourceBootstrap(ignore map[autopilot.NodeID]struct{}, numAddrs uint32,
|
||||
var addrs []*lnwire.NetAddress
|
||||
for _, bootStrapper := range bootStrappers {
|
||||
// If we already have enough addresses, then we can exit early
|
||||
// w/o querying the additional boostrappers.
|
||||
// w/o querying the additional bootstrappers.
|
||||
if uint32(len(addrs)) >= numAddrs {
|
||||
break
|
||||
}
|
||||
@@ -85,7 +85,7 @@ type ChannelGraphBootstrapper struct {
|
||||
chanGraph autopilot.ChannelGraph
|
||||
|
||||
// hashAccumulator is a set of 32 random bytes that are read upon the
|
||||
// creation of the channel graph boostrapper. We use this value to
|
||||
// creation of the channel graph bootstrapper. We use this value to
|
||||
// randomly select nodes within the known graph to connect to. After
|
||||
// each selection, we rotate the accumulator by hashing it with itself.
|
||||
hashAccumulator [32]byte
|
||||
@@ -257,7 +257,7 @@ var _ NetworkPeerBootstrapper = (*ChannelGraphBootstrapper)(nil)
|
||||
|
||||
// NewDNSSeedBootstrapper returns a new instance of the DNSSeedBootstrapper.
|
||||
// The set of passed seeds should point to DNS servers that properly implement
|
||||
// Lighting's DNS peer bootstrapping protocol as defined in BOLT-0010. The set
|
||||
// Lightning's DNS peer bootstrapping protocol as defined in BOLT-0010. The set
|
||||
// of passed DNS seeds should come in pairs, with the second host name to be
|
||||
// used as a fallback for manual TCP resolution in the case of an error
|
||||
// receiving the UDP response. The second host should return a single A record
|
||||
|
||||
+13
-13
@@ -27,7 +27,7 @@ var (
|
||||
// messageStoreKey is a key used to create a top level bucket in
|
||||
// the gossiper database, used for storing messages that are to
|
||||
// be sent to peers. Currently this is used for reliably sending
|
||||
// AnnounceSignatures messages, by peristing them until a send
|
||||
// AnnounceSignatures messages, by persisting them until a send
|
||||
// operation has succeeded.
|
||||
messageStoreKey = []byte("message-store")
|
||||
)
|
||||
@@ -184,7 +184,7 @@ type AuthenticatedGossiper struct {
|
||||
// as we know it.
|
||||
bestHeight uint32
|
||||
|
||||
// selfKey is the identity public key of the backing Lighting node.
|
||||
// selfKey is the identity public key of the backing Lightning node.
|
||||
selfKey *btcec.PublicKey
|
||||
|
||||
// channelMtx is used to restrict the database access to one
|
||||
@@ -315,7 +315,7 @@ func (d *AuthenticatedGossiper) SynchronizeNode(pub *btcec.PublicKey) error {
|
||||
// channel forwarding policies for the specified channels. If no channels are
|
||||
// specified, then the update will be applied to all outgoing channels from the
|
||||
// source node. Policy updates are done in two stages: first, the
|
||||
// AuthenticatedGossiper ensures the update has been committed by dependant
|
||||
// AuthenticatedGossiper ensures the update has been committed by dependent
|
||||
// sub-systems, then it signs and broadcasts new updates to the network.
|
||||
func (d *AuthenticatedGossiper) PropagateChanPolicyUpdate(
|
||||
newSchema routing.ChannelPolicy, chanPoints ...wire.OutPoint) error {
|
||||
@@ -493,7 +493,7 @@ func (d *deDupedAnnouncements) Reset() {
|
||||
// reset is the private version of the Reset method. We have this so we can
|
||||
// call this method within method that are already holding the lock.
|
||||
func (d *deDupedAnnouncements) reset() {
|
||||
// Storage of each type of announcement (channel anouncements, channel
|
||||
// Storage of each type of announcement (channel announcements, channel
|
||||
// updates, node announcements) is set to an empty map where the
|
||||
// appropriate key points to the corresponding lnwire.Message.
|
||||
d.channelAnnouncements = make(map[lnwire.ShortChannelID]msgWithSenders)
|
||||
@@ -502,7 +502,7 @@ func (d *deDupedAnnouncements) reset() {
|
||||
}
|
||||
|
||||
// addMsg adds a new message to the current batch. If the message is already
|
||||
// persent in the current batch, then this new instance replaces the latter,
|
||||
// present in the current batch, then this new instance replaces the latter,
|
||||
// and the set of senders is updated to reflect which node sent us this
|
||||
// message.
|
||||
func (d *deDupedAnnouncements) addMsg(message networkMsg) {
|
||||
@@ -590,7 +590,7 @@ func (d *deDupedAnnouncements) addMsg(message networkMsg) {
|
||||
sender := routing.NewVertex(message.peer)
|
||||
deDupKey := routing.NewVertex(msg.NodeID)
|
||||
|
||||
// We do the same for node annonuncements as we did for channel
|
||||
// We do the same for node announcements as we did for channel
|
||||
// updates, as they also carry a timestamp.
|
||||
oldTimestamp := uint32(0)
|
||||
mws, ok := d.nodeAnnouncements[deDupKey]
|
||||
@@ -823,7 +823,7 @@ func (d *AuthenticatedGossiper) networkHandler() {
|
||||
trickleTimer := time.NewTicker(d.cfg.TrickleDelay)
|
||||
defer trickleTimer.Stop()
|
||||
|
||||
// To start, we'll first check to see if there're any stale channels
|
||||
// To start, we'll first check to see if there are any stale channels
|
||||
// that we need to re-transmit.
|
||||
if err := d.retransmitStaleChannels(); err != nil {
|
||||
log.Errorf("unable to rebroadcast stale channels: %v",
|
||||
@@ -861,7 +861,7 @@ func (d *AuthenticatedGossiper) networkHandler() {
|
||||
policyUpdate.errResp <- nil
|
||||
|
||||
case announcement := <-d.networkMsgs:
|
||||
// Channel annoucnement signatures are the only message
|
||||
// Channel announcement signatures are the only message
|
||||
// that we'll process serially.
|
||||
if _, ok := announcement.msg.(*lnwire.AnnounceSignatures); ok {
|
||||
emittedAnnouncements := d.processNetworkAnnouncement(
|
||||
@@ -875,10 +875,10 @@ func (d *AuthenticatedGossiper) networkHandler() {
|
||||
continue
|
||||
}
|
||||
|
||||
// We'll set up any dependant, and wait until a free
|
||||
// We'll set up any dependent, and wait until a free
|
||||
// slot for this job opens up, this allow us to not
|
||||
// have thousands of goroutines active.
|
||||
validationBarrier.InitJobDependancies(announcement.msg)
|
||||
validationBarrier.InitJobDependencies(announcement.msg)
|
||||
|
||||
go func() {
|
||||
defer validationBarrier.CompleteJob()
|
||||
@@ -1147,11 +1147,11 @@ func (d *AuthenticatedGossiper) processChanPolicyUpdate(
|
||||
return chanUpdates, nil
|
||||
}
|
||||
|
||||
// processRejectedEdge examines a rejected edge to see if we can eexrtact any
|
||||
// processRejectedEdge examines a rejected edge to see if we can extract any
|
||||
// new announcements from it. An edge will get rejected if we already added
|
||||
// the same edge without AuthProof to the graph. If the received announcement
|
||||
// contains a proof, we can add this proof to our edge. We can end up in this
|
||||
// situatation in the case where we create a channel, but for some reason fail
|
||||
// situation in the case where we create a channel, but for some reason fail
|
||||
// to receive the remote peer's proof, while the remote peer is able to fully
|
||||
// assemble the proof and craft the ChannelAnnouncement.
|
||||
func (d *AuthenticatedGossiper) processRejectedEdge(chanAnnMsg *lnwire.ChannelAnnouncement,
|
||||
@@ -1938,7 +1938,7 @@ func (d *AuthenticatedGossiper) sendAnnSigReliably(
|
||||
// we do not succeed in sending it to the peer, we'll fetch it
|
||||
// from the DB next time we start, and retry. We use the peer ID
|
||||
// + shortChannelID as key, as there possibly is more than one
|
||||
// channel oepning in progress to the same peer.
|
||||
// channel opening in progress to the same peer.
|
||||
var key [41]byte
|
||||
copy(key[:33], remotePeer.SerializeCompressed())
|
||||
binary.BigEndian.PutUint64(key[33:], msg.ShortChannelID.ToUint64())
|
||||
|
||||
+13
-13
@@ -534,7 +534,7 @@ func TestProcessAnnouncement(t *testing.T) {
|
||||
case msg := <-ctx.broadcastedMessage:
|
||||
assertSenderExistence(na.NodeID, msg)
|
||||
case <-time.After(2 * trickleDelay):
|
||||
t.Fatal("announcememt wasn't proceeded")
|
||||
t.Fatal("announcement wasn't proceeded")
|
||||
}
|
||||
|
||||
if len(ctx.router.nodes) != 1 {
|
||||
@@ -562,7 +562,7 @@ func TestProcessAnnouncement(t *testing.T) {
|
||||
case msg := <-ctx.broadcastedMessage:
|
||||
assertSenderExistence(na.NodeID, msg)
|
||||
case <-time.After(2 * trickleDelay):
|
||||
t.Fatal("announcememt wasn't proceeded")
|
||||
t.Fatal("announcement wasn't proceeded")
|
||||
}
|
||||
|
||||
if len(ctx.router.infos) != 1 {
|
||||
@@ -590,7 +590,7 @@ func TestProcessAnnouncement(t *testing.T) {
|
||||
case msg := <-ctx.broadcastedMessage:
|
||||
assertSenderExistence(na.NodeID, msg)
|
||||
case <-time.After(2 * trickleDelay):
|
||||
t.Fatal("announcememt wasn't proceeded")
|
||||
t.Fatal("announcement wasn't proceeded")
|
||||
}
|
||||
|
||||
if len(ctx.router.edges) != 1 {
|
||||
@@ -663,17 +663,17 @@ func TestPrematureAnnouncement(t *testing.T) {
|
||||
select {
|
||||
case <-ctx.broadcastedMessage:
|
||||
case <-time.After(2 * trickleDelay):
|
||||
t.Fatal("announcememt wasn't broadcasted")
|
||||
t.Fatal("announcement wasn't broadcasted")
|
||||
}
|
||||
|
||||
if len(ctx.router.infos) != 1 {
|
||||
t.Fatalf("edge was't added to router: %v", err)
|
||||
t.Fatalf("edge wasn't added to router: %v", err)
|
||||
}
|
||||
|
||||
select {
|
||||
case <-ctx.broadcastedMessage:
|
||||
case <-time.After(2 * trickleDelay):
|
||||
t.Fatal("announcememt wasn't broadcasted")
|
||||
t.Fatal("announcement wasn't broadcasted")
|
||||
}
|
||||
|
||||
if len(ctx.router.edges) != 1 {
|
||||
@@ -1132,7 +1132,7 @@ func TestSignatureAnnouncementRetry(t *testing.T) {
|
||||
}
|
||||
|
||||
// When the peer comes online, the gossiper gets notified, and should
|
||||
// retry sending the AnnnounceSignatures. We make the SendToPeer
|
||||
// retry sending the AnnounceSignatures. We make the SendToPeer
|
||||
// method work again.
|
||||
sentToPeer := make(chan lnwire.Message, 1)
|
||||
ctx.gossiper.cfg.SendToPeer = func(target *btcec.PublicKey,
|
||||
@@ -1141,7 +1141,7 @@ func TestSignatureAnnouncementRetry(t *testing.T) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Notify that peer is now online. THis should trigger a new call
|
||||
// Notify that peer is now online. This should trigger a new call
|
||||
// to SendToPeer.
|
||||
close(conChan)
|
||||
|
||||
@@ -1369,7 +1369,7 @@ func TestSignatureAnnouncementRetryAtStartup(t *testing.T) {
|
||||
t.Fatalf("gossiper did not send message when peer came online")
|
||||
}
|
||||
|
||||
// Now exchanging the remote channel proof, the channel annoncement
|
||||
// Now exchanging the remote channel proof, the channel announcement
|
||||
// broadcast should continue as normal.
|
||||
select {
|
||||
case err = <-ctx.gossiper.ProcessRemoteAnnouncement(batch.remoteProofAnn,
|
||||
@@ -1562,7 +1562,7 @@ func TestSignatureAnnouncementFullProofWhenRemoteProof(t *testing.T) {
|
||||
case msg := <-sentToPeer:
|
||||
_, ok := msg.(*lnwire.ChannelAnnouncement)
|
||||
if !ok {
|
||||
t.Fatalf("expected ChannelAnnouncement, intead got %T", msg)
|
||||
t.Fatalf("expected ChannelAnnouncement, instead got %T", msg)
|
||||
}
|
||||
case <-time.After(2 * time.Second):
|
||||
t.Fatal("did not send local proof to peer")
|
||||
@@ -1638,7 +1638,7 @@ func TestDeDuplicatedAnnouncements(t *testing.T) {
|
||||
t.Fatal("channel update not replaced in batch")
|
||||
}
|
||||
|
||||
// Adding an announcment with a later timestamp should replace the
|
||||
// Adding an announcement with a later timestamp should replace the
|
||||
// stored one.
|
||||
ua3, err := createUpdateAnnouncement(0, 0, nodeKeyPriv1, timestamp+1)
|
||||
if err != nil {
|
||||
@@ -1790,7 +1790,7 @@ func TestDeDuplicatedAnnouncements(t *testing.T) {
|
||||
}
|
||||
|
||||
// TestReceiveRemoteChannelUpdateFirst tests that if we receive a
|
||||
// CHannelUpdate from the remote before we have processed our
|
||||
// ChannelUpdate from the remote before we have processed our
|
||||
// own ChannelAnnouncement, it will be reprocessed later, after
|
||||
// our ChannelAnnouncement.
|
||||
func TestReceiveRemoteChannelUpdateFirst(t *testing.T) {
|
||||
@@ -1822,7 +1822,7 @@ func TestReceiveRemoteChannelUpdateFirst(t *testing.T) {
|
||||
localKey := batch.nodeAnn1.NodeID
|
||||
remoteKey := batch.nodeAnn2.NodeID
|
||||
|
||||
// Recreate the case where the remote node is snding us its ChannelUpdate
|
||||
// Recreate the case where the remote node is sending us its ChannelUpdate
|
||||
// before we have been able to process our own ChannelAnnouncement and
|
||||
// ChannelUpdate.
|
||||
err = <-ctx.gossiper.ProcessRemoteAnnouncement(batch.chanUpdAnn2, remoteKey)
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ import (
|
||||
|
||||
// createChanAnnouncement is a helper function which creates all channel
|
||||
// announcements given the necessary channel related database items. This
|
||||
// function is used to transform out databse structs into the coresponding wire
|
||||
// sturcts for announcing new channels to other peers, or simply syncing up a
|
||||
// function is used to transform out database structs into the corresponding wire
|
||||
// structs for announcing new channels to other peers, or simply syncing up a
|
||||
// peer's initial routing table upon connect.
|
||||
func createChanAnnouncement(chanProof *channeldb.ChannelAuthProof,
|
||||
chanInfo *channeldb.ChannelEdgeInfo,
|
||||
|
||||
Reference in new issue
Block a user