Skip to content

Commit 1422df2

Browse files
authored
Merge pull request #8521 from zhiqiangxu/typo
chore: fix typo
2 parents 15c7686 + 74a290b commit 1422df2

File tree

4 files changed

+25
-24
lines changed

4 files changed

+25
-24
lines changed

input/script_utils.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ func SenderHTLCScript(senderHtlcKey, receiverHtlcKey,
376376

377377
// We'll drop the OP_IF return value off the top of the stack so we can
378378
// reconstruct the multi-sig script used as an off-chain covenant. If
379-
// two valid signatures are provided, ten then output will be deemed as
379+
// two valid signatures are provided, then the output will be deemed as
380380
// spendable.
381381
builder.AddOp(txscript.OP_DROP)
382382
builder.AddOp(txscript.OP_2)
@@ -391,8 +391,9 @@ func SenderHTLCScript(senderHtlcKey, receiverHtlcKey,
391391

392392
// Hash the top item of the stack and compare it with the hash160 of
393393
// the payment hash, which is already the sha256 of the payment
394-
// pre-image. By using this little trick we're able save space on-chain
395-
// as the witness includes a 20-byte hash rather than a 32-byte hash.
394+
// pre-image. By using this little trick we're able to save space
395+
// on-chain as the witness includes a 20-byte hash rather than a
396+
// 32-byte hash.
396397
builder.AddOp(txscript.OP_HASH160)
397398
builder.AddData(Ripemd160H(paymentHash))
398399
builder.AddOp(txscript.OP_EQUALVERIFY)
@@ -2009,7 +2010,7 @@ func LockTimeToSequence(isSeconds bool, locktime uint32) uint32 {
20092010
// <revokeKey>
20102011
// OP_ELSE
20112012
// <numRelativeBlocks> OP_CHECKSEQUENCEVERIFY OP_DROP
2012-
// <timeKey>
2013+
// <selfKey>
20132014
// OP_ENDIF
20142015
// OP_CHECKSIG
20152016
func CommitScriptToSelf(csvTimeout uint32, selfKey, revokeKey *btcec.PublicKey) ([]byte, error) {
@@ -2358,7 +2359,7 @@ func TaprootCommitSpendRevoke(signer Signer, signDesc *SignDescriptor,
23582359
// OP_ELSE
23592360
// <absoluteLeaseExpiry> OP_CHECKLOCKTIMEVERIFY OP_DROP
23602361
// <numRelativeBlocks> OP_CHECKSEQUENCEVERIFY OP_DROP
2361-
// <timeKey>
2362+
// <selfKey>
23622363
// OP_ENDIF
23632364
// OP_CHECKSIG
23642365
func LeaseCommitScriptToSelf(selfKey, revokeKey *btcec.PublicKey,
@@ -2961,7 +2962,7 @@ func CommitSpendAnchorAnyone(script []byte) (wire.TxWitness, error) {
29612962
// SingleTweakBytes computes set of bytes we call the single tweak. The purpose
29622963
// of the single tweak is to randomize all regular delay and payment base
29632964
// points. To do this, we generate a hash that binds the commitment point to
2964-
// the pay/delay base point. The end end results is that the basePoint is
2965+
// the pay/delay base point. The end result is that the basePoint is
29652966
// tweaked as follows:
29662967
//
29672968
// - key = basePoint + sha256(commitPoint || basePoint)*G

lnwallet/channel.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,14 @@ const (
175175
Add updateType = iota
176176

177177
// Fail is an update type which removes a prior HTLC entry from the
178-
// log. Adding a Fail entry to ones log will modify the _remote_
179-
// parties update log once a new commitment view has been evaluated
178+
// log. Adding a Fail entry to one's log will modify the _remote_
179+
// party's update log once a new commitment view has been evaluated
180180
// which contains the Fail entry.
181181
Fail
182182

183183
// MalformedFail is an update type which removes a prior HTLC entry
184-
// from the log. Adding a MalformedFail entry to ones log will modify
185-
// the _remote_ parties update log once a new commitment view has been
184+
// from the log. Adding a MalformedFail entry to one's log will modify
185+
// the _remote_ party's update log once a new commitment view has been
186186
// evaluated which contains the MalformedFail entry. The difference
187187
// from Fail type lie in the different data we have to store.
188188
MalformedFail
@@ -376,7 +376,7 @@ type PaymentDescriptor struct {
376376
// PayDescsFromRemoteLogUpdates converts a slice of LogUpdates received from the
377377
// remote peer into PaymentDescriptors to inform a link's forwarding decisions.
378378
//
379-
// NOTE: The provided `logUpdates` MUST corresponding exactly to either the Adds
379+
// NOTE: The provided `logUpdates` MUST correspond exactly to either the Adds
380380
// or SettleFails in this channel's forwarding package at `height`.
381381
func PayDescsFromRemoteLogUpdates(chanID lnwire.ShortChannelID, height uint64,
382382
logUpdates []channeldb.LogUpdate) ([]*PaymentDescriptor, error) {
@@ -489,9 +489,9 @@ type commitment struct {
489489
ourMessageIndex uint64
490490
theirMessageIndex uint64
491491

492-
// [our|their]HtlcIndex are the current running counters for the HTLC's
492+
// [our|their]HtlcIndex are the current running counters for the HTLCs
493493
// offered by either party. This value is incremented each time a party
494-
// offers a new HTLC. The log update methods that consume HTLC's will
494+
// offers a new HTLC. The log update methods that consume HTLCs will
495495
// reference these counters, rather than the running cumulative message
496496
// counters.
497497
ourHtlcIndex uint64
@@ -555,7 +555,7 @@ type commitment struct {
555555
// locateOutputIndex is a small helper function to locate the output index of a
556556
// particular HTLC within the current commitment transaction. The duplicate map
557557
// massed in is to be retained for each output within the commitment
558-
// transition. This ensures that we don't assign multiple HTLC's to the same
558+
// transition. This ensures that we don't assign multiple HTLCs to the same
559559
// index within the commitment transaction.
560560
func locateOutputIndex(p *PaymentDescriptor, tx *wire.MsgTx, ourCommit bool,
561561
dups map[PaymentHash][]int32, cltvs []uint32) (int32, error) {
@@ -570,7 +570,7 @@ func locateOutputIndex(p *PaymentDescriptor, tx *wire.MsgTx, ourCommit bool,
570570
return false
571571
}
572572

573-
// If this their commitment transaction, we'll be trying to locate
573+
// If this is their commitment transaction, we'll be trying to locate
574574
// their pkScripts, otherwise we'll be looking for ours. This is
575575
// required as the commitment states are asymmetric in order to ascribe
576576
// blame in the case of a contract breach.
@@ -603,7 +603,7 @@ func locateOutputIndex(p *PaymentDescriptor, tx *wire.MsgTx, ourCommit bool,
603603
"cltv=%v", pkScript, p.Amount, p.Timeout)
604604
}
605605

606-
// populateHtlcIndexes modifies the set of HTLC's locked-into the target view
606+
// populateHtlcIndexes modifies the set of HTLCs locked-into the target view
607607
// to have full indexing information populated. This information is required as
608608
// we need to keep track of the indexes of each HTLC in order to properly write
609609
// the current state to disk, and also to locate the PaymentDescriptor
@@ -612,7 +612,7 @@ func (c *commitment) populateHtlcIndexes(chanType channeldb.ChannelType,
612612
cltvs []uint32) error {
613613

614614
// First, we'll set up some state to allow us to locate the output
615-
// index of the all the HTLC's within the commitment transaction. We
615+
// index of the all the HTLCs within the commitment transaction. We
616616
// must keep this index so we can validate the HTLC signatures sent to
617617
// us.
618618
dups := make(map[PaymentHash][]int32)
@@ -774,7 +774,7 @@ func (c *commitment) toDiskCommit(ourCommit bool) *channeldb.ChannelCommitment {
774774
// diskHtlcToPayDesc converts an HTLC previously written to disk within a
775775
// commitment state to the form required to manipulate in memory within the
776776
// commitment struct and updateLog. This function is used when we need to
777-
// restore commitment state written do disk back into memory once we need to
777+
// restore commitment state written to disk back into memory once we need to
778778
// restart a channel session.
779779
func (lc *LightningChannel) diskHtlcToPayDesc(feeRate chainfee.SatPerKWeight,
780780
commitHeight uint64, htlc *channeldb.HTLC, localCommitKeys,
@@ -791,7 +791,7 @@ func (lc *LightningChannel) diskHtlcToPayDesc(feeRate chainfee.SatPerKWeight,
791791
chanType = lc.channelState.ChanType
792792
)
793793

794-
// If the either outputs is dust from the local or remote node's
794+
// If the either output is dust from the local or remote node's
795795
// perspective, then we don't need to generate the scripts as we only
796796
// generate them in order to locate the outputs within the commitment
797797
// transaction. As we'll mark dust with a special output index in the
@@ -1234,8 +1234,8 @@ func compactLogs(ourLog, theirLog *updateLog,
12341234
//
12351235
// The state machine has for main methods:
12361236
// - .SignNextCommitment()
1237-
// - Called one one wishes to sign the next commitment, either initiating a
1238-
// new state update, or responding to a received commitment.
1237+
// - Called once when one wishes to sign the next commitment, either
1238+
// initiating a new state update, or responding to a received commitment.
12391239
// - .ReceiveNewCommitment()
12401240
// - Called upon receipt of a new commitment from the remote party. If the
12411241
// new commitment is valid, then a revocation should immediately be
@@ -2879,7 +2879,7 @@ func createBreachRetributionLegacy(revokedLog *channeldb.ChannelCommitment,
28792879
// HtlcIsDust determines if an HTLC output is dust or not depending on two
28802880
// bits: if the HTLC is incoming and if the HTLC will be placed on our
28812881
// commitment transaction, or theirs. These two pieces of information are
2882-
// require as we currently used second-level HTLC transactions as off-chain
2882+
// required as we currently used second-level HTLC transactions as off-chain
28832883
// covenants. Depending on the two bits, we'll either be using a timeout or
28842884
// success transaction which have different weights.
28852885
func HtlcIsDust(chanType channeldb.ChannelType,

lnwallet/commitment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ func genSegwitV0HtlcScript(chanType channeldb.ChannelType,
10211021
// being applied to their commitment transaction or ours.
10221022
switch {
10231023
// The HTLC is paying to us, and being applied to our commitment
1024-
// transaction. So we need to use the receiver's version of HTLC the
1024+
// transaction. So we need to use the receiver's version of the HTLC
10251025
// script.
10261026
case isIncoming && ourCommit:
10271027
witnessScript, err = input.ReceiverHTLCScript(

lnwire/update_add_htlc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const OnionPacketSize = 1366
1515
// HTLC to his remote commitment transaction. In addition to information
1616
// detailing the value, the ID, expiry, and the onion blob is also included
1717
// which allows Bob to derive the next hop in the route. The HTLC added by this
18-
// message is to be added to the remote node's "pending" HTLC's. A subsequent
18+
// message is to be added to the remote node's "pending" HTLCs. A subsequent
1919
// CommitSig message will move the pending HTLC to the newly created commitment
2020
// transaction, marking them as "staged".
2121
type UpdateAddHTLC struct {

0 commit comments

Comments
 (0)