Skip to content

Commit

Permalink
Small bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bjohnson5 committed Oct 24, 2024
1 parent e3d8612 commit 106c656
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion blast_core/src/blast_model_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ impl BlastModelManager {
};

let chan_string = response.get_ref().channels.clone();
if chan_string != "" {
if !chan_string.is_empty() {
let mut c: Vec<String> = chan_string.split(',').map(|s| s.trim().to_string()).collect();
chans.append(&mut c);
}
Expand Down
3 changes: 3 additions & 0 deletions blast_core/src/blast_simln_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ impl BlastSimLnManager {
for connection in nodes {
let node: Arc<Mutex<dyn LightningNode>> = match connection {
NodeConnection::LND(c) => {
if c.address.is_empty() {
continue;
}
Arc::new(Mutex::new(LndNode::new(c).await?))
},
NodeConnection::CLN(c) => Arc::new(Mutex::new(ClnNode::new(c).await?)),
Expand Down
2 changes: 2 additions & 0 deletions blast_models/blast_ldk/blast_ldk/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ impl BlastRpc for BlastLdkServer {
result.push_str(&format!("{}: {} -> {},", key, &value.source, value.pk.to_string()));
}

result.pop();

let chan_response = BlastGetModelChannelsResponse { channels: result };
let response = Response::new(chan_response);
Ok(response)
Expand Down
2 changes: 1 addition & 1 deletion blast_models/blast_lnd/blast_rpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (s *BlastRpcServer) GetModelChannels(ctx context.Context, request *pb.Blast

result := sb.String()
if len(result) > 0 {
result = result[:len(result)-2]
result = result[:len(result)-1]
}

response := &pb.BlastGetModelChannelsResponse{
Expand Down

0 comments on commit 106c656

Please sign in to comment.