Skip to content

Commit e7d0d8a

Browse files
Fix typos
1 parent 265c083 commit e7d0d8a

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/ln/channel.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ enum ChannelState {
154154
AwaitingRemoteRevoke = (1 << 7),
155155
}
156156

157-
// TODO: We should refactor this to be a Inbound/OutboundChannel until initial setup handshaking
157+
// TODO: We should refactor this to be an Inbound/OutboundChannel until initial setup handshaking
158158
// has been completed, and then turn into a Channel to get compiler-time enforcement of things like
159159
// calling get_channel_id() before we're set up or things like get_outbound_funding_signed on an
160160
// inbound channel.
@@ -897,7 +897,7 @@ impl Channel {
897897
}
898898

899899
/// Handles a funding_signed message from the remote end.
900-
/// If this call is successfull, broadcast the funding transaction (and not before!)
900+
/// If this call is successful, broadcast the funding transaction (and not before!)
901901
pub fn funding_signed(&mut self, msg: &msgs::FundingSigned) -> Result<(), HandleError> {
902902
if !self.channel_outbound {
903903
return Err(HandleError{err: "Received funding_signed for an inbound channel?", msg: None});
@@ -933,7 +933,7 @@ impl Channel {
933933
}
934934

935935
//TODO: Note that this must be a duplicate of the previous commitment point they sent us,
936-
//as otherwise we will have a commitment transaction that they cant revoke (well, kinda,
936+
//as otherwise we will have a commitment transaction that they can't revoke (well, kinda,
937937
//they can by sending two revoke_and_acks back-to-back, but not really). This appears to be
938938
//a protocol oversight, but I assume I'm just missing something.
939939
if self.their_cur_commitment_point != msg.next_per_commitment_point {
@@ -1333,7 +1333,7 @@ impl Channel {
13331333
self.funding_tx_confirmed_in = header.bitcoin_hash();
13341334

13351335
//TODO: Note that this must be a duplicate of the previous commitment point they sent us,
1336-
//as otherwise we will have a commitment transaction that they cant revoke (well, kinda,
1336+
//as otherwise we will have a commitment transaction that they can't revoke (well, kinda,
13371337
//they can by sending two revoke_and_acks back-to-back, but not really). This appears to be
13381338
//a protocol oversight, but I assume I'm just missing something.
13391339
let next_per_commitment_secret = match self.build_local_commitment_secret(self.cur_local_commitment_transaction_number) {
@@ -1466,7 +1466,7 @@ impl Channel {
14661466
/// Panics if called at some time other than immediately after initial handshake, if called twice,
14671467
/// or if called on an inbound channel.
14681468
/// Note that channel_id changes during this call!
1469-
/// Do NOT broadcast the funding transaction until after a successfull funding_signed call!
1469+
/// Do NOT broadcast the funding transaction until after a successful funding_signed call!
14701470
pub fn get_outbound_funding_created(&mut self, funding_txid: Sha256dHash, funding_output_index: u16) -> Result<msgs::FundingCreated, HandleError> {
14711471
if !self.channel_outbound {
14721472
panic!("Tried to create outbound funding_created message on an inbound channel!");
@@ -1694,7 +1694,7 @@ mod tests {
16941694
chan.local_keys.payment_base_key = SecretKey::from_slice(&secp_ctx, &hex_bytes("1111111111111111111111111111111111111111111111111111111111111111").unwrap()[..]).unwrap();
16951695
chan.local_keys.delayed_payment_base_key = SecretKey::from_slice(&secp_ctx, &hex_bytes("3333333333333333333333333333333333333333333333333333333333333333").unwrap()[..]).unwrap();
16961696
chan.local_keys.htlc_base_key = SecretKey::from_slice(&secp_ctx, &hex_bytes("1111111111111111111111111111111111111111111111111111111111111111").unwrap()[..]).unwrap();
1697-
// chan.local_keys.commitment_seed isnt derived in the test vectors :(
1697+
// chan.local_keys.commitment_seed isn't derived in the test vectors :(
16981698

16991699
chan.channel_monitor.set_funding_info(Sha256dHash::from_hex("8984484a580b825b9972d7adb15050b3ab624ccd731946b3eeddb92f4e7ef6be").unwrap(), 0);
17001700

src/ln/channelmanager.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ impl ChannelManager {
297297
for (i, keys) in onion_keys.iter().enumerate() {
298298
if i == payloads.len() - 1 { continue; }
299299
let mut chacha = ChaCha20::new(&keys.rho, &[0u8; 8]);
300-
chacha.process(&ChannelManager::ZERO, &mut buf); // We dont have a seek function :(
300+
chacha.process(&ChannelManager::ZERO, &mut buf); // We don't have a seek function :(
301301
ChannelManager::xor_bufs(&mut res[0..(i + 1)*65], &buf[(20 - i)*65..21*65]);
302302
}
303303
res
@@ -557,7 +557,7 @@ impl ChannelManager {
557557
// will automatically handle building the update_add_htlc and
558558
// commitment_signed messages when we can.
559559
// TODO: Do some kind of timer to set the channel as !is_live()
560-
// as we dont really want others relying on us relaying through
560+
// as we don't really want others relying on us relaying through
561561
// this channel currently :/.
562562
}
563563
}
@@ -737,7 +737,7 @@ impl ChannelMessageHandler for ChannelManager {
737737
}
738738

739739
fn handle_funding_created(&self, their_node_id: &PublicKey, msg: &msgs::FundingCreated) -> Result<msgs::FundingSigned, HandleError> {
740-
//TODO: broke this - a node shouldnt be able to get their channel removed by sending a
740+
//TODO: broke this - a node shouldn't be able to get their channel removed by sending a
741741
//funding_created a second time, or long after the first, or whatever (note this also
742742
//leaves the short_to_id map in a busted state.
743743
let chan = {
@@ -814,7 +814,7 @@ impl ChannelMessageHandler for ChannelManager {
814814
}
815815

816816
fn handle_update_add_htlc(&self, their_node_id: &PublicKey, msg: &msgs::UpdateAddHTLC) -> Result<(), msgs::HandleError> {
817-
//TODO: BOLT 4 points out a specific attack where a peer may re-send a onion packet and
817+
//TODO: BOLT 4 points out a specific attack where a peer may re-send an onion packet and
818818
//determine the state of the payment based on our response/if we forward anything/the time
819819
//we take to respond. We should take care to avoid allowing such an attack.
820820
//
@@ -829,7 +829,7 @@ impl ChannelMessageHandler for ChannelManager {
829829
let associated_data = Vec::new(); //TODO: What to put here?
830830

831831
if msg.onion_routing_packet.version != 0 {
832-
//TODO: Spec doesnt indicate if we should only hash hop_data here (and in other
832+
//TODO: Spec doesn't indicate if we should only hash hop_data here (and in other
833833
//sha256_of_onion error data packets), or the entire onion_routing_packet. Either way,
834834
//the hash doesn't really serve any purpuse - in the case of hashing all data, the
835835
//receiving node would have to brute force to figure out which version was put in the
@@ -919,7 +919,7 @@ impl ChannelMessageHandler for ChannelManager {
919919
});
920920
}
921921

922-
// Note that we could obviously respond immediately with a update_fulfill_htlc
922+
// Note that we could obviously respond immediately with an update_fulfill_htlc
923923
// message, however that would leak that we are the recipient of this payment, so
924924
// instead we stay symmetric with the forwarding case, only responding (after a
925925
// delay) once they've send us a commitment_signed!

src/ln/peer_handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub struct MessageHandler {
2020
/// Provides an object which can be used to send data to and which uniquely identifies a connection
2121
/// to a remote host. You will need to be able to generate multiple of these which meet Eq and
2222
/// implement Hash to meet the PeerManager API.
23-
/// For effeciency, Clone should be relatively cheap for this type.
23+
/// For efficiency, Clone should be relatively cheap for this type.
2424
/// You probably want to just extend an int and put a file descriptor in a struct and implement
2525
/// send_data.
2626
pub trait SocketDescriptor : cmp::Eq + hash::Hash + Clone {

src/util/transaction_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ pub fn sort_outputs<T>(outputs: &mut Vec<(TxOut, T)>) { //TODO: Make static and
88
Ordering::Less
99
} else if b.0.value < a.0.value {
1010
Ordering::Greater
11-
} else if a.0.script_pubkey[..] < b.0.script_pubkey[..] { //TODO: ordering of scripts shouldnt be len-based
11+
} else if a.0.script_pubkey[..] < b.0.script_pubkey[..] { //TODO: ordering of scripts shouldn't be len-based
1212
Ordering::Less
13-
} else if b.0.script_pubkey[..] < a.0.script_pubkey[..] { //TODO: ordering of scripts shouldnt be len-based
13+
} else if b.0.script_pubkey[..] < a.0.script_pubkey[..] { //TODO: ordering of scripts shouldn't be len-based
1414
Ordering::Greater
1515
} else {
1616
Ordering::Equal

0 commit comments

Comments
 (0)