-
Notifications
You must be signed in to change notification settings - Fork 283
Add channelbalances API call
#2196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f5ec539
f2e6937
90e4abf
8e56e59
298ce80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,7 +132,7 @@ object Relayer extends Logging { | |
| } | ||
|
|
||
| case class RelayForward(add: UpdateAddHtlc) | ||
| case class UsableBalance(remoteNodeId: PublicKey, shortChannelId: ShortChannelId, canSend: MilliSatoshi, canReceive: MilliSatoshi, isPublic: Boolean) | ||
| case class ChannelBalance(remoteNodeId: PublicKey, shortChannelId: ShortChannelId, canSend: MilliSatoshi, canReceive: MilliSatoshi, isPublic: Boolean, isEnabled: Boolean) | ||
|
|
||
| /** | ||
| * Get the list of local outgoing channels. | ||
|
|
@@ -141,12 +141,13 @@ object Relayer extends Logging { | |
| */ | ||
| case class GetOutgoingChannels(enabledOnly: Boolean = true) | ||
| case class OutgoingChannel(nextNodeId: PublicKey, channelUpdate: ChannelUpdate, prevChannelUpdate: Option[ChannelUpdate], commitments: AbstractCommitments) { | ||
| def toUsableBalance: UsableBalance = UsableBalance( | ||
| def toChannelBalance: ChannelBalance = ChannelBalance( | ||
| remoteNodeId = nextNodeId, | ||
| shortChannelId = channelUpdate.shortChannelId, | ||
| canSend = commitments.availableBalanceForSend, | ||
| canReceive = commitments.availableBalanceForReceive, | ||
| isPublic = commitments.announceChannel) | ||
| isPublic = commitments.announceChannel, | ||
| isEnabled = channelUpdate.channelFlags.isEnabled) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually there is a subtlety here: Ideally we would expose two bools: I really don't think it's worth fixing, unless someone has a very compelling use-case for it, but I thought it was interesting to raise the point. |
||
| } | ||
| case class OutgoingChannels(channels: Seq[OutgoingChannel]) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| [{"remoteNodeId":"03af0ed6052cf28d670665549bc86f4b721c9fdb309d40c58f5811f63966e005d0","shortChannelId":"0x0x1","canSend":100000000,"canReceive":20000000,"isPublic":true,"isEnabled":true},{"remoteNodeId":"03af0ed6052cf28d670665549bc86f4b721c9fdb309d40c58f5811f63966e005d0","shortChannelId":"0x0x2","canSend":0,"canReceive":30000000,"isPublic":false,"isEnabled":false}] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| [{"remoteNodeId":"03af0ed6052cf28d670665549bc86f4b721c9fdb309d40c58f5811f63966e005d0","shortChannelId":"0x0x1","canSend":100000000,"canReceive":20000000,"isPublic":true},{"remoteNodeId":"03af0ed6052cf28d670665549bc86f4b721c9fdb309d40c58f5811f63966e005d0","shortChannelId":"0x0x2","canSend":400000000,"canReceive":30000000,"isPublic":false}] | ||
| [{"remoteNodeId":"03af0ed6052cf28d670665549bc86f4b721c9fdb309d40c58f5811f63966e005d0","shortChannelId":"0x0x1","canSend":100000000,"canReceive":20000000,"isPublic":true,"isEnabled":true},{"remoteNodeId":"03af0ed6052cf28d670665549bc86f4b721c9fdb309d40c58f5811f63966e005d0","shortChannelId":"0x0x2","canSend":400000000,"canReceive":30000000,"isPublic":false,"isEnabled":true}] |
Uh oh!
There was an error while loading. Please reload this page.