-
Notifications
You must be signed in to change notification settings - Fork 163
Closed
Labels
enhancementNew feature or requestNew feature or requestup for grabsAnyone can work on thisAnyone can work on this
Description
Is your feature request related to a problem? Please describe.
Yes, the problem is: sometimes we need balanced channels to do some stuff while testing and developing locally, but balancing them manually takes precious time.
Describe the solution you'd like
A button that we can click and have the channels balanced automatically (in the background by polar).
Suggestion
Here is a pseudo-code to balance the channels:
button.onClick((event) => {
for (channel of getChannels()) {
amountPeer1 = channel.getAmountPeer1()
amountPeer2 = channel.getAmountPeer2()
if (amountPeer1 == amountPeer2)
continue;
if (amountPeer 1 > amountPeer2) {
invoice = channel.generateInvoiceForPeer2({ amount: (amountPeer1-amountPeer)/2 })
channel.payInvoiceToPeer2(invoice)
} else {
// same thing as above
}
}
})
I can try do this, but some guidance is welcomed
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestup for grabsAnyone can work on thisAnyone can work on this