Merge pull request #2824 from shuoer86/main
authorElias Rohrer <dev@tnull.de>
Mon, 15 Jan 2024 09:38:03 +0000 (10:38 +0100)
committerGitHub <noreply@github.com>
Mon, 15 Jan 2024 09:38:03 +0000 (10:38 +0100)
Fix typos

CONTRIBUTING.md
lightning-invoice/src/ser.rs
lightning/src/ln/peer_handler.rs
lightning/src/routing/router.rs
lightning/src/util/wakers.rs

index 78c515007d03a75ba2b0261d25ebc74f46531244..b57217165e6b79c239351ebeef85647bafdab18a 100644 (file)
@@ -148,7 +148,7 @@ Security
 --------
 
 Security is the primary focus of `rust-lightning`; disclosure of security
-vulnerabilites helps prevent user loss of funds. If you believe a vulnerability
+vulnerabilities helps prevent user loss of funds. If you believe a vulnerability
 may affect other Lightning implementations, please inform them.
 
 You can find further information on submitting (possible) vulnerabilities in the
index fe42f72b6532f593083049832a07f31272cd43a5..dc63783bfa388fc35f7394d8cc243471683df99e 100644 (file)
@@ -52,7 +52,7 @@ impl<'a, W: WriteBase32> BytesToBase32<'a, W> {
                }
 
                // Combine all bits from buffer with enough bits from this rounds byte so that they fill
-               // a u5. Save reamining bits from byte to buffer.
+               // a u5. Save remaining bits from byte to buffer.
                let from_buffer = self.buffer >> 3;
                let from_byte = byte >> (3 + self.buffer_bits); // buffer_bits <= 4
 
index 6ffffec4dd0bd94febc085ed998051c7090da5eb..9a9aea9ae971e2ef727431795e47be35ca70b890 100644 (file)
@@ -1609,7 +1609,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
                }
 
                if let wire::Message::GossipTimestampFilter(_msg) = message {
-                       // When supporting gossip messages, start inital gossip sync only after we receive
+                       // When supporting gossip messages, start initial gossip sync only after we receive
                        // a GossipTimestampFilter
                        if peer_lock.their_features.as_ref().unwrap().supports_gossip_queries() &&
                                !peer_lock.sent_gossip_timestamp_filter {
@@ -2216,7 +2216,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
                                                                                        log_pubkey!(node_id));
                                                                        }
                                                                        // We do not have the peers write lock, so we just store that we're
-                                                                       // about to disconenct the peer and do it after we finish
+                                                                       // about to disconnect the peer and do it after we finish
                                                                        // processing most messages.
                                                                        let msg = msg.map(|msg| wire::Message::<<<CMH as core::ops::Deref>::Target as wire::CustomMessageReader>::CustomMessage>::Error(msg));
                                                                        peers_to_disconnect.insert(node_id, msg);
@@ -2225,7 +2225,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
                                                                        log_trace!(logger, "Handling DisconnectPeer HandleError event in peer_handler for node {} with message {}",
                                                                                log_pubkey!(node_id), msg.data);
                                                                        // We do not have the peers write lock, so we just store that we're
-                                                                       // about to disconenct the peer and do it after we finish
+                                                                       // about to disconnect the peer and do it after we finish
                                                                        // processing most messages.
                                                                        peers_to_disconnect.insert(node_id, Some(wire::Message::Warning(msg)));
                                                                },
index 277661862e3361d72a3b3b44975a928422a87db9..485fd239128df8ab39b0806723a7d3d6b6e24e3a 100644 (file)
@@ -2706,7 +2706,7 @@ where L::Target: Logger {
                                                }
                                        }
 
-                                       // Means we succesfully traversed from the payer to the payee, now
+                                       // Means we successfully traversed from the payer to the payee, now
                                        // save this path for the payment route. Also, update the liquidity
                                        // remaining on the used hops, so that we take them into account
                                        // while looking for more paths.
@@ -7803,7 +7803,7 @@ mod tests {
        fn do_min_htlc_overpay_violates_max_htlc(blinded_payee: bool) {
                // Test that if overpaying to meet a later hop's min_htlc and causes us to violate an earlier
                // hop's max_htlc, we don't consider that candidate hop valid. Previously we would add this hop
-               // to `targets` and build an invalid path with it, and subsquently hit a debug panic asserting
+               // to `targets` and build an invalid path with it, and subsequently hit a debug panic asserting
                // that the used liquidity for a hop was less than its available liquidity limit.
                let secp_ctx = Secp256k1::new();
                let logger = Arc::new(ln_test_utils::TestLogger::new());
@@ -8452,7 +8452,7 @@ pub(crate) mod bench_utils {
                                                        }
                                                        break;
                                                }
-                                               // If we couldn't find a path with a higer amount, reduce and try again.
+                                               // If we couldn't find a path with a higher amount, reduce and try again.
                                                score_amt /= 100;
                                        }
 
index 37c036da9594747ea81b142e151ff960c2892dad..14e6bbe64a24524367661da70772f603538c3b55 100644 (file)
@@ -491,7 +491,7 @@ mod tests {
        }
 
        // Rather annoyingly, there's no safe way in Rust std to construct a Waker despite it being
-       // totally possible to construct from a trait implementation (though somewhat less effecient
+       // totally possible to construct from a trait implementation (though somewhat less efficient
        // compared to a raw VTable). Instead, we have to write out a lot of boilerplate to build a
        // waker, which we do here with a trivial Arc<AtomicBool> data element to track woke-ness.
        const WAKER_V_TABLE: RawWakerVTable = RawWakerVTable::new(waker_clone, wake, wake_by_ref, drop);