Skip to content

Commit

Permalink
Merge pull request #395 from chenyukang/yukang-fix-181
Browse files Browse the repository at this point in the history
Fix compiling warning for rustc 1.81
  • Loading branch information
quake authored Dec 16, 2024
2 parents 4e42c80 + a8cf122 commit 66076a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/fiber/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ where
"Signing commitment transactions while shutdown is pending, current state {:?}",
&state.state
);
CommitmentSignedFlags::PendingShutdown(flags)
CommitmentSignedFlags::PendingShutdown()
} else {
return Err(ProcessingChannelError::InvalidState(format!(
"Unable to process commitment_signed message in shutdowning state with flags {:?}",
Expand Down Expand Up @@ -1173,7 +1173,7 @@ where
state.maybe_transition_to_tx_signatures(flags, &self.network)?;
}
CommitmentSignedFlags::ChannelReady() => {}
CommitmentSignedFlags::PendingShutdown(_) => {
CommitmentSignedFlags::PendingShutdown() => {
state.maybe_transition_to_shutdown(&self.network)?;
}
}
Expand Down Expand Up @@ -3072,7 +3072,7 @@ bitflags! {
#[derive(Debug)]
enum CommitmentSignedFlags {
SigningCommitment(SigningCommitmentFlags),
PendingShutdown(ShuttingDownFlags),
PendingShutdown(),
ChannelReady(),
}

Expand Down Expand Up @@ -5192,7 +5192,7 @@ impl ChannelActorState {
"Signing commitment transactions while shutdown is pending, current state {:?}",
&self.state
);
CommitmentSignedFlags::PendingShutdown(flags)
CommitmentSignedFlags::PendingShutdown()
} else {
return Err(ProcessingChannelError::InvalidState(format!(
"Unable to process commitment_signed message in shutdowning state with flags {:?}",
Expand Down Expand Up @@ -5246,11 +5246,11 @@ impl ChannelActorState {
self.update_state(ChannelState::SigningCommitment(flags));
self.maybe_transition_to_tx_signatures(flags, network)?;
}
CommitmentSignedFlags::ChannelReady() | CommitmentSignedFlags::PendingShutdown(_) => {
CommitmentSignedFlags::ChannelReady() | CommitmentSignedFlags::PendingShutdown() => {
self.send_revoke_and_ack_message(network);
match flags {
CommitmentSignedFlags::ChannelReady() => {}
CommitmentSignedFlags::PendingShutdown(_) => {
CommitmentSignedFlags::PendingShutdown() => {
// TODO: Handle error in the below function call.
// We've already updated our state, we should never fail here.
self.maybe_transition_to_shutdown(network)?;
Expand Down
8 changes: 4 additions & 4 deletions src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ use tokio::sync::{mpsc::Sender, RwLock};

pub type InvoiceCommandWithReply = (InvoiceCommand, Sender<crate::Result<String>>);

fn build_server(addr: &str) -> Server {
#[cfg(not(release))]
async fn build_server(addr: &str) -> Server {
#[cfg(debug_assertions)]
{
// Use socket2 to set reuse address and reuse port,
// so that we can restart the server without waiting for the port to be released.
Expand All @@ -56,7 +56,7 @@ fn build_server(addr: &str) -> Server {
.build_from_tcp(socket)
.expect("JsonRPC server built from TCP")
}
#[cfg(release)]
#[cfg(not(debug_assertions))]
{
Server::builder()
.build(addr)
Expand All @@ -76,7 +76,7 @@ pub async fn start_rpc<
network_graph: Arc<RwLock<NetworkGraph<S>>>,
) -> ServerHandle {
let listening_addr = config.listening_addr.as_deref().unwrap_or("[::]:0");
let server = build_server(listening_addr);
let server = build_server(listening_addr).await;
let mut methods = InvoiceRpcServerImpl::new(store.clone(), fiber_config).into_rpc();
if let Some(network_actor) = network_actor {
let info = InfoRpcServerImpl::new(network_actor.clone(), store.clone());
Expand Down

0 comments on commit 66076a7

Please sign in to comment.