multi: fix a variety of typos throughout the repo

This commit is contained in:
Trevin Hofmann authored and Olaoluwa Osuntokun committed 2017-01-17 17:02:56 -08:00
1 parent 49df1b0737
commit 40c7bac3aa
38 files changed
+311 -311

No files matched your search

+29 -29
View File
@@ -26,11 +26,11 @@ const (
htlcQueueSize = 50
)
// link represents a an active channel capable of forwarding HTLC's. Each
// link represents an active channel capable of forwarding HTLCs. Each
// active channel registered with the htlc switch creates a new link which will
// be used for forwarding outgoing HTLC's. The link also has additional
// meta-data such as the current available bandwidth of the link (in satoshis)
// which aide the switch in optimally forwarding HTLC's.
// be used for forwarding outgoing HTLCs. The link also has additional
// metadata such as the current available bandwidth of the link (in satoshis)
// which aid the switch in optimally forwarding HTLCs.
type link struct {
capacity btcutil.Amount
@@ -75,7 +75,7 @@ type circuitKey [32]byte
// link forwards an HTLC add request which initiates the creation of the
// circuit. The onion routing information contained within this message is
// used to identify the settle/clear ends of the circuit. A circuit may be
// re-used (not torndown) in the case that multiple HTLC's with the send RHash
// re-used (not torndown) in the case that multiple HTLCs with the send RHash
// are sent.
type paymentCircuit struct {
// TODO(roasbeef): add reference count so know when to delete?
@@ -99,14 +99,14 @@ type paymentCircuit struct {
settle *link
}
// htlcSwitch is a central messaging bus for all incoming/outgoing HTLC's.
// htlcSwitch is a central messaging bus for all incoming/outgoing HTLCs.
// Connected peers with active channels are treated as named interfaces which
// refer to active channels as links. A link is the switch's message
// communication point with the goroutine that manages an active channel. New
// links are registered each time a channel is created, and unregistered once
// the channel is closed. The switch manages the hand-off process for multi-hop
// HTLC's, forwarding HTLC's initiated from within the daemon, and additionally
// splitting up incoming/outgoing HTLC's to a particular interface amongst many
// HTLCs, forwarding HTLCs initiated from within the daemon, and additionally
// splitting up incoming/outgoing HTLCs to a particular interface amongst many
// links (payment fragmentation).
// TODO(roasbeef): active sphinx circuits need to be synced to disk
type htlcSwitch struct {
@@ -145,8 +145,8 @@ type htlcSwitch struct {
// the RPC system.
outgoingPayments chan *htlcPacket
// htlcPlex is the channel in which all connected links use to
// coordinate the setup/tear down of Sphinx (onion routing) payment
// htlcPlex is the channel which all connected links use to
// coordinate the setup/teardown of Sphinx (onion routing) payment
// circuits. Active links forward any add/settle messages over this
// channel each state transition, sending new adds/settles which are
// fully locked in.
@@ -215,12 +215,12 @@ func (h *htlcSwitch) SendHTLC(htlcPkt *htlcPacket) error {
}
// htlcForwarder is responsible for optimally forwarding (and possibly
// fragmenting) incoming/outgoing HTLC's amongst all active interfaces and
// fragmenting) incoming/outgoing HTLCs amongst all active interfaces and
// their links. The duties of the forwarder are similar to that of a network
// switch, in that it facilitates multi-hop payments by acting as a central
// messaging bus. The switch communicates will active links to create, manage,
// and tear down active onion routed payments.Each active channel is modeled
// as networked device with meta-data such as the available payment bandwidth,
// and tear down active onion routed payments. Each active channel is modeled
// as networked device with metadata such as the available payment bandwidth,
// and total link capacity.
func (h *htlcSwitch) htlcForwarder() {
// TODO(roasbeef): track pending payments here instead of within each peer?
@@ -305,7 +305,7 @@ out:
hswcLog.Errorf("unable to find dest end of "+
"circuit: %x", nextHop)
// We we're unable to locate the
// We were unable to locate the
// next-hop as encoded within the
// Sphinx packet. Therefore, we send a
// cancellation message back to the
@@ -435,7 +435,7 @@ out:
// route. In response, we'll terminate the payment
// circuit and propagate the error backwards.
case *lnwire.CancelHTLC:
// In order to properly handle the error, well
// In order to properly handle the error, we'll
// need to look up the original circuit that
// the incoming HTLC created.
circuit, ok := h.paymentCircuits[pkt.payHash]
@@ -446,7 +446,7 @@ out:
}
// Since an outgoing HTLC we sent on the clear
// link as he cancelled, we update the
// link has been cancelled, we update the
// bandwidth of the clear link, restoring the
// value of the HTLC worth.
n := atomic.AddInt64(&circuit.clear.availableBandwidth,
@@ -472,7 +472,7 @@ out:
continue
}
hswcLog.Infof("Sent %v satoshis, received %v satoshi in "+
hswcLog.Infof("Sent %v satoshis, received %v satoshis in "+
"the last 10 seconds (%v tx/sec)",
satSent.ToUnit(btcutil.AmountSatoshi),
satRecv.ToUnit(btcutil.AmountSatoshi),
@@ -487,8 +487,8 @@ out:
h.wg.Done()
}
// networkAdmin is responsible for handline requests to register, unregister,
// and close any link. In the event that a unregister requests leaves an
// networkAdmin is responsible for handling requests to register, unregister,
// and close any link. In the event that an unregister request leaves an
// interface with no active links, that interface is garbage collected.
func (h *htlcSwitch) networkAdmin() {
out:
@@ -540,7 +540,7 @@ func (h *htlcSwitch) handleRegisterLink(req *registerLinkMsg) {
// Next, update the onion index which is used to look up the
// settle/clear links during multi-hop payments and to dispatch
// outgoing payments initiated by a local sub-system.
// outgoing payments initiated by a local subsystem.
var onionId [ripemd160.Size]byte
copy(onionId[:], btcutil.Hash160(req.peer.addr.IdentityKey.SerializeCompressed()))
@@ -614,8 +614,8 @@ func (h *htlcSwitch) handleUnregisterLink(req *unregisterLinkMsg) {
hex.EncodeToString(chanInterface[:]))
// Delete the peer from the onion index so that the
// htlcForwarder knows not attempt to forward any further
// HTLC's in this direction.
// htlcForwarder knows not to attempt to forward any further
// HTLCs in this direction.
var onionId [ripemd160.Size]byte
copy(onionId[:], btcutil.Hash160(req.remoteID))
delete(h.onionIndex, onionId)
@@ -655,7 +655,7 @@ func (h *htlcSwitch) handleCloseLink(req *closeLinkReq) {
}
// handleLinkUpdate processes the link info update message by adjusting the
// channels available bandwidth by the delta specified within the message.
// channel's available bandwidth by the delta specified within the message.
func (h *htlcSwitch) handleLinkUpdate(req *linkInfoUpdateMsg) {
h.chanIndexMtx.RLock()
link := h.chanIndex[*req.targetLink]
@@ -708,9 +708,9 @@ type unregisterLinkMsg struct {
done chan struct{}
}
// UnregisterLink requets the htlcSwitch to register the new active link. An
// UnregisterLink requests the htlcSwitch to register the new active link. An
// unregistered link will no longer be considered a candidate to forward
// HTLC's.
// HTLCs.
func (h *htlcSwitch) UnregisterLink(remotePub *btcec.PublicKey, chanPoint *wire.OutPoint) {
done := make(chan struct{}, 1)
rawPub := remotePub.SerializeCompressed()
@@ -725,7 +725,7 @@ func (h *htlcSwitch) UnregisterLink(remotePub *btcec.PublicKey, chanPoint *wire.
<-done
}
// LinkCloseType is a enum which signals the type of channel closure the switch
// LinkCloseType is an enum which signals the type of channel closure the switch
// should execute.
type LinkCloseType uint8
@@ -734,7 +734,7 @@ const (
// be attempted.
CloseRegular LinkCloseType = iota
// CloseBreach indicates that a channel breach has been dtected, and
// CloseBreach indicates that a channel breach has been detected, and
// the link should immediately be marked as unavailable.
CloseBreach
)
@@ -750,7 +750,7 @@ type closeLinkReq struct {
err chan error
}
// CloseLink closes an active link targetted by it's channel point. Closing the
// CloseLink closes an active link targetted by its channel point. Closing the
// link initiates a cooperative channel closure iff forceClose is false. If
// forceClose is true, then a unilateral channel closure is executed.
// TODO(roasbeef): consolidate with UnregisterLink?
@@ -771,7 +771,7 @@ func (h *htlcSwitch) CloseLink(chanPoint *wire.OutPoint,
}
// linkInfoUpdateMsg encapsulates a request for the htlc switch to update the
// meta-data related to the target link.
// metadata related to the target link.
type linkInfoUpdateMsg struct {
targetLink *wire.OutPoint