trivial: Fix spelling errors

- Fixes some spelling in code comments and a couple of function names
This commit is contained in:
Michael Rooke committed 2023-09-21 22:35:33 -04:00
1 parent ec585431a9
commit 78d9996620
30 files changed
+65 -52

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@ const (
// DataLossProtectRequired is a feature bit that indicates that a peer
// *requires* the other party know about the data-loss-protect optional
// feature. If the remote peer does not know of such a feature, then
// the sending peer SHOLUD disconnect them. The data-loss-protect
// the sending peer SHOULD disconnect them. The data-loss-protect
// feature allows a peer that's lost partial data to recover their
// settled funds of the latest commitment state.
DataLossProtectRequired FeatureBit = 0
+1 -1
View File
@@ -254,7 +254,7 @@ func BenchmarkReadMessage(b *testing.B) {
// type.
//
// TODO(yy): the following testing messages are created somewhat arbitrary. We
// should standardlize each of the testing messages so that a better baseline
// should standardize each of the testing messages so that a better baseline
// can be used.
func makeAllMessages(t testing.TB, r *rand.Rand) []lnwire.Message {
msgAll := []lnwire.Message{}
+14 -8
View File
@@ -589,14 +589,14 @@ func (f *FailInvalidOnionKey) Error() string {
return fmt.Sprintf("InvalidOnionKey(onion_sha=%x)", f.OnionSHA256[:])
}
// parseChannelUpdateCompatabilityMode will attempt to parse a channel updated
// parseChannelUpdateCompatibilityMode will attempt to parse a channel updated
// encoded into an onion error payload in two ways. First, we'll try the
// compatibility oriented version wherein we'll _skip_ the length prefixing on
// the channel update message. Older versions of c-lighting do this so we'll
// attempt to parse these messages in order to retain compatibility. If we're
// unable to pull out a fully valid version, then we'll fall back to the
// regular parsing mechanism which includes the length prefix an NO type byte.
func parseChannelUpdateCompatabilityMode(reader io.Reader, length uint16,
func parseChannelUpdateCompatibilityMode(reader io.Reader, length uint16,
chanUpdate *ChannelUpdate, pver uint32) error {
// Instantiate a LimitReader because there may be additional data
@@ -683,7 +683,8 @@ func (f *FailTemporaryChannelFailure) Decode(r io.Reader, pver uint32) error {
if length != 0 {
f.Update = &ChannelUpdate{}
return parseChannelUpdateCompatabilityMode(
return parseChannelUpdateCompatibilityMode(
r, length, f.Update, pver,
)
}
@@ -767,7 +768,8 @@ func (f *FailAmountBelowMinimum) Decode(r io.Reader, pver uint32) error {
}
f.Update = ChannelUpdate{}
return parseChannelUpdateCompatabilityMode(
return parseChannelUpdateCompatibilityMode(
r, length, &f.Update, pver,
)
}
@@ -835,7 +837,8 @@ func (f *FailFeeInsufficient) Decode(r io.Reader, pver uint32) error {
}
f.Update = ChannelUpdate{}
return parseChannelUpdateCompatabilityMode(
return parseChannelUpdateCompatibilityMode(
r, length, &f.Update, pver,
)
}
@@ -903,7 +906,8 @@ func (f *FailIncorrectCltvExpiry) Decode(r io.Reader, pver uint32) error {
}
f.Update = ChannelUpdate{}
return parseChannelUpdateCompatabilityMode(
return parseChannelUpdateCompatibilityMode(
r, length, &f.Update, pver,
)
}
@@ -960,7 +964,8 @@ func (f *FailExpiryTooSoon) Decode(r io.Reader, pver uint32) error {
}
f.Update = ChannelUpdate{}
return parseChannelUpdateCompatabilityMode(
return parseChannelUpdateCompatibilityMode(
r, length, &f.Update, pver,
)
}
@@ -1024,7 +1029,8 @@ func (f *FailChannelDisabled) Decode(r io.Reader, pver uint32) error {
}
f.Update = ChannelUpdate{}
return parseChannelUpdateCompatabilityMode(
return parseChannelUpdateCompatibilityMode(
r, length, &f.Update, pver,
)
}
+4 -4
View File
@@ -120,10 +120,10 @@ func testEncodeDecodeTlv(t *testing.T, testFailure FailureMessage) {
require.Equal(t, testFailure, failure)
}
// TestChannelUpdateCompatabilityParsing tests that we're able to properly read
// TestChannelUpdateCompatibilityParsing tests that we're able to properly read
// out channel update messages encoded in an onion error payload that was
// written in the legacy (type prefixed) format.
func TestChannelUpdateCompatabilityParsing(t *testing.T) {
func TestChannelUpdateCompatibilityParsing(t *testing.T) {
t.Parallel()
// We'll start by taking out test channel update, and encoding it into
@@ -137,7 +137,7 @@ func TestChannelUpdateCompatabilityParsing(t *testing.T) {
// able to decode it using our compatibility method, as it's a regular
// encoded channel update message.
var newChanUpdate ChannelUpdate
err := parseChannelUpdateCompatabilityMode(
err := parseChannelUpdateCompatibilityMode(
&b, uint16(b.Len()), &newChanUpdate, 0,
)
require.NoError(t, err, "unable to parse channel update")
@@ -164,7 +164,7 @@ func TestChannelUpdateCompatabilityParsing(t *testing.T) {
// We should be able to properly parse the encoded channel update
// message even with the extra two bytes.
var newChanUpdate2 ChannelUpdate
err = parseChannelUpdateCompatabilityMode(
err = parseChannelUpdateCompatibilityMode(
&b, uint16(b.Len()), &newChanUpdate2, 0,
)
require.NoError(t, err, "unable to parse channel update")