Skip to content

Commit

Permalink
Rename inbound liq to total_inbound_liquidity_msats
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgranhao committed Aug 6, 2024
1 parent ee25097 commit 544c928
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion libs/sdk-core/src/breez_services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3275,7 +3275,7 @@ pub(crate) mod tests {
max_chan_reserve_msats: 0,
connected_peers: vec!["1111".to_string()],
max_receivable_single_payment_amount_msat: 2_000,
inbound_liquidity_msats: 10_000,
total_inbound_liquidity_msats: 10_000,
}
}
}
4 changes: 3 additions & 1 deletion libs/sdk-core/src/bridge_generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2061,7 +2061,9 @@ impl support::IntoDart for NodeState {
self.max_receivable_single_payment_amount_msat
.into_into_dart()
.into_dart(),
self.inbound_liquidity_msats.into_into_dart().into_dart(),
self.total_inbound_liquidity_msats
.into_into_dart()
.into_dart(),
]
.into_dart()
}
Expand Down
6 changes: 3 additions & 3 deletions libs/sdk-core/src/greenlight/node_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ impl NodeAPI for Greenlight {
// calculate payment limits and inbound liquidity
let mut max_payable: u64 = 0;
let mut max_receivable_single_channel: u64 = 0;
let mut inbound_liquidity_msats: u64 = 0;
let mut total_inbound_liquidity_msats: u64 = 0;
opened_channels.iter().try_for_each(|c| -> Result<()> {
max_payable += c
.spendable_msat
Expand All @@ -955,7 +955,7 @@ impl NodeAPI for Greenlight {
.as_ref()
.map(|a| a.msat)
.unwrap_or_default();
inbound_liquidity_msats += receivable_amount;
total_inbound_liquidity_msats += receivable_amount;
if receivable_amount > max_receivable_single_channel {
max_receivable_single_channel = receivable_amount;
}
Expand All @@ -979,7 +979,7 @@ impl NodeAPI for Greenlight {
max_chan_reserve_msats: channels_balance - min(max_payable, channels_balance),
connected_peers,
max_receivable_single_payment_amount_msat: max_receivable_single_channel,
inbound_liquidity_msats,
total_inbound_liquidity_msats,
};
let mut htlc_list: Vec<Htlc> = Vec::new();
for channel in all_channel_models.clone() {
Expand Down
2 changes: 1 addition & 1 deletion libs/sdk-core/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ pub struct NodeState {
pub max_receivable_single_payment_amount_msat: u64,

/// Total receivable on all available channels
pub inbound_liquidity_msats: u64,
pub total_inbound_liquidity_msats: u64,
}

/// Internal response to a [crate::node_api::NodeAPI::pull_changed] call
Expand Down
6 changes: 3 additions & 3 deletions libs/sdk-flutter/lib/bridge_generated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ class NodeState {
final int maxReceivableSinglePaymentAmountMsat;

/// Total receivable on all available channels
final int inboundLiquidityMsats;
final int totalInboundLiquidityMsats;

const NodeState({
required this.id,
Expand All @@ -1139,7 +1139,7 @@ class NodeState {
required this.maxChanReserveMsats,
required this.connectedPeers,
required this.maxReceivableSinglePaymentAmountMsat,
required this.inboundLiquidityMsats,
required this.totalInboundLiquidityMsats,
});
}

Expand Down Expand Up @@ -3769,7 +3769,7 @@ class BreezSdkCoreImpl implements BreezSdkCore {
maxChanReserveMsats: _wire2api_u64(arr[9]),
connectedPeers: _wire2api_StringList(arr[10]),
maxReceivableSinglePaymentAmountMsat: _wire2api_u64(arr[11]),
inboundLiquidityMsats: _wire2api_u64(arr[12]),
totalInboundLiquidityMsats: _wire2api_u64(arr[12]),
);
}

Expand Down

0 comments on commit 544c928

Please sign in to comment.