Skip to content

Commit

Permalink
Merge pull request #2824 from shuoer86/main
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
tnull committed Jan 15, 2024
2 parents 4b70921 + fff6616 commit ea5de93
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions lightning/src/ln/peer_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand All @@ -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)));
},
Expand Down
6 changes: 3 additions & 3 deletions lightning/src/routing/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion lightning/src/util/wakers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ea5de93

Please sign in to comment.