general: fix typos

This commit is contained in:
Andrey Samokhvalov 2016-10-15 16:18:38 +03:00
parent fd163ccf9d
commit 14c6770b76
9 changed files with 42 additions and 41 deletions

@ -24,7 +24,7 @@ const (
// reservationWithCtx encapsulates a pending channel reservation. This wrapper
// struct is used internally within the funding manager to track and progress
// the funding workflow initiated by incoming/outgoing meethods from the target
// the funding workflow initiated by incoming/outgoing methods from the target
// peer. Additionally, this struct houses a response and error channel which is
// used to respond to the caller in the case a channel workflow is initiated
// via a local signal such as RPC.
@ -121,7 +121,7 @@ type fundingManager struct {
// state of the funding manager.
queries chan interface{}
// fundingRequests is a channel used to recieve channel initiation
// fundingRequests is a channel used to receive channel initiation
// requests from a local sub-system within the daemon.
fundingRequests chan *initFundingMsg
@ -286,7 +286,7 @@ func (f *fundingManager) handlePendingChannels(msg *pendingChansReq) {
}
// processFundingRequest sends a message to the fundingManager allowing it to
// intiate the new funding workflow with the source peer.
// initiate the new funding workflow with the source peer.
func (f *fundingManager) processFundingRequest(msg *lnwire.SingleFundingRequest, peer *peer) {
f.fundingMsgs <- &fundingRequestMsg{msg, peer}
}
@ -319,7 +319,7 @@ func (f *fundingManager) handleFundingRequest(fmsg *fundingRequestMsg) {
return
}
// Once the reservation has been created succesfully, we add it to this
// Once the reservation has been created successfully, we add it to this
// peers map of pending reservations to track this particular reservation
// until either abort or completion.
f.resMtx.Lock()
@ -719,6 +719,7 @@ func (f *fundingManager) handleInitFundingMsg(msg *initFundingMsg) {
if _, ok := f.activeReservations[msg.peer.id]; !ok {
f.activeReservations[msg.peer.id] = make(pendingChannels)
}
f.activeReservations[msg.peer.id][chanID] = &reservationWithCtx{
reservation: reservation,
peer: msg.peer,

@ -152,8 +152,8 @@ type PaymentDescriptor struct {
// commitment represents a commitment to a new state within an active channel.
// New commitments can be initiated by either side. Commitments are ordered
// into a commitment chain, with one existing for both parties. Each side can
// independatly extend the other side's commitment chain, up to a certain
// "revocation window", which once reached, dissallows new commitments until
// independently extend the other side's commitment chain, up to a certain
// "revocation window", which once reached, disallows new commitments until
// the local nodes receives the revocation for the remote node's chain tail.
type commitment struct {
// height represents the commitment height of this commitment, or the
@ -162,7 +162,7 @@ type commitment struct {
// [our|their]MessageIndex are indexes into the HTLC log, up to which
// this commitment transaction includes. These indexes allow both sides
// to independantly, and concurrent send create new commitments. Each
// to independently, and concurrent send create new commitments. Each
// new commitment sent to the remote party includes an index in the
// shared log which details which of their updates we're including in
// this new commitment.
@ -232,7 +232,7 @@ func (c *commitment) toChannelDelta() (*channeldb.ChannelDelta, error) {
// commitmentChain represents a chain of unrevoked commitments. The tail of the
// chain is the latest fully signed, yet unrevoked commitment. Two chains are
// tracked, one for the local node, and another for the remote node. New
// commitmetns we create locally extend the remote node's chain, and vice
// commitments we create locally extend the remote node's chain, and vice
// versa. Commitment chains are allowed to grow to a bounded length, after
// which the tail needs to be "dropped" before new commitments can be received.
// The tail is "dropped" when the owner of the chain sends a revocation for the
@ -1278,7 +1278,7 @@ func (lc *LightningChannel) ReceiveHTLC(htlc *lnwire.HTLCAddRequest) uint32 {
return pd.Index
}
// SettleHTLC attempst to settle an existing outstanding received HTLC. The
// SettleHTLC attempts to settle an existing outstanding received HTLC. The
// remote log index of the HTLC settled is returned in order to facilitate
// creating the corresponding wire message. In the case the supplied pre-image
// is invalid, an error is returned.

@ -302,7 +302,7 @@ func createTestChannels(revocationWindow int) (*LightningChannel, *LightningChan
// local node (Alice in this case) creates a new outgoing HTLC to bob, commits
// this change, then bob immediately commits a settlement of the HTLC after the
// initial add is fully commited in both commit chains.
// TODO(roasbeef): write higher level framework to excercise various states of
// TODO(roasbeef): write higher level framework to exercise various states of
// the state machine
// * DSL language perhaps?
// * constructed via input/output files
@ -348,7 +348,7 @@ func TestSimpleAddSettleWorkflow(t *testing.T) {
t.Fatalf("alice unable to sign commitment: %v", err)
}
// Bob recieves this signature message, then generates a signature for
// Bob receives this signature message, then generates a signature for
// Alice's commitment transaction, and the revocation to his prior
// commitment transaction.
if err := bobChannel.ReceiveNewCommitment(aliceSig, bobLogIndex); err != nil {
@ -363,12 +363,12 @@ func TestSimpleAddSettleWorkflow(t *testing.T) {
t.Fatalf("unable to generate bob revocation: %v", err)
}
// Alice then proceses bob's signature, and generates a revocation for
// Alice then processes bob's signature, and generates a revocation for
// bob.
if err := aliceChannel.ReceiveNewCommitment(bobSig, aliceLogIndex); err != nil {
t.Fatalf("alice unable to process bob's new commitment: %v", err)
}
// Alice then processes this revocation, sending her own revovation for
// Alice then processes this revocation, sending her own recovation for
// her prior commitment transaction. Alice shouldn't have any HTLC's to
// forward since she's sending anoutgoing HTLC.
if htlcs, err := aliceChannel.ReceiveRevocation(bobRevocation); err != nil {

@ -62,8 +62,8 @@ func (e *ErrInsufficientFunds) Error() string {
// initFundingReserveReq is the first message sent to initiate the workflow
// required to open a payment channel with a remote peer. The initial required
// paramters are configurable accross channels. These paramters are to be chosen
// depending on the fee climate within the network, and time value of funds to
// parameters are configurable across channels. These parameters are to be
// chosen depending on the fee climate within the network, and time value of funds to
// be locked up within the channel. Upon success a ChannelReservation will be
// created in order to track the lifetime of this pending channel. Outputs
// selected will be 'locked', making them unavailable, for any other pending
@ -239,7 +239,7 @@ type LightningWallet struct {
// This mutex MUST be held when performing coin selection in order to
// avoid inadvertently creating multiple funding transaction which
// double spend inputs accross each other.
// double spend inputs across each other.
coinSelectMtx sync.RWMutex
// A wrapper around a namespace within boltdb reserved for ln-based
@ -263,14 +263,14 @@ type LightningWallet struct {
Signer Signer
// chainIO is an instance of the BlockChainIO interface. chainIO is
// used to lookup the existance of outputs within the utxo set.
// used to lookup the existence of outputs within the UTXO set.
chainIO BlockChainIO
// rootKey is the root HD key dervied from a WalletController private
// rootKey is the root HD key derived from a WalletController private
// key. This rootKey is used to derive all LN specific secrets.
rootKey *hdkeychain.ExtendedKey
// All messages to the wallet are to be sent accross this channel.
// All messages to the wallet are to be sent across this channel.
msgChan chan interface{}
// Incomplete payment channels are stored in the map below. An intent
@ -423,7 +423,7 @@ func (l *LightningWallet) GetIdentitykey() (*btcec.PrivateKey, error) {
return identityKey.ECPrivKey()
}
// requestHandler is the primary goroutine(s) resposible for handling, and
// requestHandler is the primary goroutine(s) responsible for handling, and
// dispatching relies to all messages.
func (l *LightningWallet) requestHandler() {
out:
@ -455,15 +455,15 @@ out:
l.wg.Done()
}
// InitChannelReservation kicks off the 3-step workflow required to succesfully
// InitChannelReservation kicks off the 3-step workflow required to successfully
// open a payment channel with a remote node. As part of the funding
// reservation, the inputs selected for the funding transaction are 'locked'.
// This ensures that multiple channel reservations aren't double spending the
// same inputs in the funding transaction. If reservation initialization is
// succesful, a ChannelReservation containing our completed contribution is
// returned. Our contribution contains all the items neccessary to allow the
// successful, a ChannelReservation containing our completed contribution is
// returned. Our contribution contains all the items necessary to allow the
// counter party to build the funding transaction, and both versions of the
// commitment transaction. Otherwise, an error occured a nil pointer along with
// commitment transaction. Otherwise, an error occurred a nil pointer along with
// an error are returned.
//
// Once a ChannelReservation has been obtained, two additional steps must be
@ -500,7 +500,7 @@ func (l *LightningWallet) handleFundingReserveRequest(req *initFundingReserveMsg
reservation := NewChannelReservation(totalCapacity, req.fundingAmount,
req.minFeeRate, l, id, req.numConfs)
// Grab the mutex on the ChannelReservation to ensure thead-safety
// Grab the mutex on the ChannelReservation to ensure thread-safety
reservation.Lock()
defer reservation.Unlock()
@ -568,9 +568,9 @@ func (l *LightningWallet) handleFundingReserveRequest(req *initFundingReserveMsg
l.fundingLimbo[id] = reservation
l.limboMtx.Unlock()
// Funding reservation request succesfully handled. The funding inputs
// Funding reservation request successfully handled. The funding inputs
// will be marked as unavailable until the reservation is either
// completed, or cancecled.
// completed, or canceled.
req.resp <- reservation
req.err <- nil
}

@ -8,11 +8,11 @@ import (
)
// ErrorGeneric represents a generic error bound to an exact channel. The
// message format is purposefully general in order to allow expressino of a wide
// message format is purposefully general in order to allow expression of a wide
// array of possible errors. Each ErrorGeneric message is directed at a particular
// open channel referenced by ChannelPoint.
type ErrorGeneric struct {
// ChannelPoint references the active channel in which the error occured
// ChannelPoint references the active channel in which the error occurred
// within. A ChannelPoint of zeroHash:0 denotes this error applies to
// the entire established connection.
ChannelPoint *wire.OutPoint
@ -22,7 +22,7 @@ type ErrorGeneric struct {
ErrorID uint16
// Problem is a human-readable string further elaborating upon the
// nature of the exact error. The maxmium allowed length of this
// nature of the exact error. The maximum allowed length of this
// message is 8192 bytes.
Problem string
}

@ -9,7 +9,7 @@ import (
// responder after the previously constructed funding transaction has achieved
// a sufficient number of confirmations. It is the initiator's duty to present
// a proof of an open channel to the responder. Otherwise, responding node may
// be vulernable to a resource exhasution attack wherein the a requesting node
// be vulnerable to a resource exhaustion attack wherein the a requesting node
// repeatedly negotiates funding transactions which are never broadcast. If the
// responding node commits resources to watch the chain for each funding
// transaction, then this attack is very cheap for the initiator.

@ -8,7 +8,7 @@ import (
)
// SingleFundingSignComplete is the message Bob sends to Alice which delivers
// a signature for Alice's version of the commitment transaction. After thie
// a signature for Alice's version of the commitment transaction. After this
// message is received and processed by Alice, she is free to broadcast the
// funding transaction.
type SingleFundingSignComplete struct {

@ -69,7 +69,7 @@ func generateListeningPorts() (int, int) {
// lightningNode represents an instance of lnd running within our test network
// harness. Each lightningNode instance also fully embedds an RPC client in
// order to programatically drive the node.
// order to pragmatically drive the node.
type lightningNode struct {
cfg *config
@ -573,9 +573,9 @@ func (n *networkHarness) WaitForTxBroadcast(ctx context.Context, txid wire.ShaHa
}
}
// OpenChannel attemps to open a channel between srcNode and destNode with the
// OpenChannel attempts to open a channel between srcNode and destNode with the
// passed channel funding parameters. If the passed context has a timeout, then
// if the timeout is reeached before the channel pending notification is
// if the timeout is reached before the channel pending notification is
// received, an error is returned.
func (n *networkHarness) OpenChannel(ctx context.Context,
srcNode, destNode *lightningNode, amt btcutil.Amount,

12
peer.go

@ -354,7 +354,7 @@ out:
break out
}
var isChanUpate bool
var isChanUpdate bool
var targetChan *wire.OutPoint
switch msg := nextMsg.(type) {
@ -374,16 +374,16 @@ out:
// TODO(roasbeef): interface for htlc update msgs
// * .(CommitmentUpdater)
case *lnwire.HTLCAddRequest:
isChanUpate = true
isChanUpdate = true
targetChan = msg.ChannelPoint
case *lnwire.HTLCSettleRequest:
isChanUpate = true
isChanUpdate = true
targetChan = msg.ChannelPoint
case *lnwire.CommitRevocation:
isChanUpate = true
isChanUpdate = true
targetChan = msg.ChannelPoint
case *lnwire.CommitSignature:
isChanUpate = true
isChanUpdate = true
targetChan = msg.ChannelPoint
case *lnwire.NeighborAckMessage,
*lnwire.NeighborHelloMessage,
@ -395,7 +395,7 @@ out:
p.server.routingMgr.ReceiveRoutingMessage(msg, graph.NewID(([32]byte)(p.lightningID)))
}
if isChanUpate {
if isChanUpdate {
// We might be receiving an update to a newly funded
// channel in which we were the responder. Therefore
// we need to possibly block until the new channel has