general: fix typos
This commit is contained in:
1 parent
fd163ccf9d
commit
14c6770b76
9 files changed
+42
-41
No files matched your search
+5
-5
@@ -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 {
|
||||
|
||||
+14
-14
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user