general: fix typos, rename variables, add comments

This commit is contained in:
Andrey Samokhvalov authored and Olaoluwa Osuntokun committed 2016-11-23 20:02:29 -06:00
1 parent b70d1f8cfe
commit 5b9e4ae61e
9 files changed
+23 -17

No files matched your search

+3 -3
View File
@@ -1014,7 +1014,7 @@ func (lc *LightningChannel) evaluateHTLCView(view *htlcView, ourBalance,
// processAddEntry evaluates the effect of an add entry within the HTLC log.
// If the HTLC hasn't yet been committed in either chain, then the height it
// was commited is updated. Keeping track of this inclusion height allows us to
// was committed is updated. Keeping track of this inclusion height allows us to
// later compact the log once the change is fully committed in both chains.
func processAddEntry(htlc *PaymentDescriptor, ourBalance, theirBalance *btcutil.Amount,
nextHeight uint64, remoteChain bool, isIncoming bool) {
@@ -1165,7 +1165,7 @@ func (lc *LightningChannel) SignNextCommitment() ([]byte, uint32, error) {
// the remote party. This method will should be called in response to the
// remote party initiating a new change, or when the remote party sends a
// signature fully accepting a new state we've initiated. If we are able to
// succesfully validate the signature, then the generated commitment is added
// successfully validate the signature, then the generated commitment is added
// to our local commitment chain. Once we send a revocation for our prior
// state, then this newly added commitment becomes our current accepted channel
// state.
@@ -1992,7 +1992,7 @@ func CreateCommitTx(fundingOutput *wire.TxIn, selfKey, theirKey *btcec.PublicKey
}
// Next, we create the script paying to them. This is just a regular
// P2WKH output, without any added CSV delay.
// P2WPKH output, without any added CSV delay.
theirWitnessKeyHash, err := commitScriptUnencumbered(theirKey)
if err != nil {
return nil, err
+4 -4
View File
@@ -135,7 +135,7 @@ func initRevocationWindows(chanA, chanB *LightningChannel, windowSize int) error
return nil
}
// forceStateTransition executes the neccessary interaction between the two
// forceStateTransition executes the necessary interaction between the two
// commitment state machines to transition to a new state locking in any
// pending updates.
func forceStateTransition(chanA, chanB *LightningChannel) error {
@@ -320,7 +320,7 @@ func createTestChannels(revocationWindow int) (*LightningChannel, *LightningChan
// TestSimpleAddSettleWorkflow tests a simple channel scenario wherein the
// 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.
// initial add is fully committed in both commit chains.
// TODO(roasbeef): write higher level framework to exercise various states of
// the state machine
// * DSL language perhaps?
@@ -389,7 +389,7 @@ func TestSimpleAddSettleWorkflow(t *testing.T) {
}
// 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.
// forward since she's sending an outgoing HTLC.
if htlcs, err := aliceChannel.ReceiveRevocation(bobRevocation); err != nil {
t.Fatalf("alice unable to rocess bob's revocation: %v", err)
} else if len(htlcs) != 0 {
@@ -441,7 +441,7 @@ func TestSimpleAddSettleWorkflow(t *testing.T) {
}
// Alice's revocation window should now be one beyond the size of the
// intial window. Same goes for Bob.
// initial window. Same goes for Bob.
if aliceChannel.revocationWindowEdge != 4 {
t.Fatalf("alice revocation window not incremented, is %v should be %v",
aliceChannel.revocationWindowEdge, 4)
+2 -2
View File
@@ -340,7 +340,7 @@ func senderHtlcSpendTimeout(commitScript []byte, outputAmt btcutil.Amount,
//
// Possible Input Scripts:
// RECVR: <sig> <preimage> 1
// REVOK: <sig> <preimage> 1 0
// REVOK: <sig> <preimage> 0 1
// SENDR: <sig> 0 0
//
// OP_IF
@@ -358,7 +358,7 @@ func senderHtlcSpendTimeout(commitScript []byte, outputAmt btcutil.Amount,
// <revoke hash> OP_EQUALVERIFY
// OP_ELSE
// //Refund
// <absolute blockehight> OP_CHECKLOCKTIMEVERIFY OP_DROP
// <absolute blockheight> OP_CHECKLOCKTIMEVERIFY OP_DROP
// OP_ENDIF
// <sender key> OP_CHECKSIG
// OP_ENDIF