mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
ln: qt channel open: fix max channel size
This commit is contained in:
parent
ae04434206
commit
cd9477c0da
2 changed files with 8 additions and 2 deletions
|
@ -202,6 +202,12 @@ class ChannelsList(MyTreeView):
|
||||||
remote_nodeid.setCursorPosition(0)
|
remote_nodeid.setCursorPosition(0)
|
||||||
if not d.exec_():
|
if not d.exec_():
|
||||||
return
|
return
|
||||||
funding_sat = '!' if max_button.isChecked() else amount_e.get_amount()
|
if max_button.isChecked() and amount_e.get_amount() < LN_MAX_FUNDING_SAT:
|
||||||
|
# if 'max' enabled and amount is strictly less than max allowed,
|
||||||
|
# that means we have fewer coins than max allowed, and hence we can
|
||||||
|
# spend all coins
|
||||||
|
funding_sat = '!'
|
||||||
|
else:
|
||||||
|
funding_sat = amount_e.get_amount()
|
||||||
connect_str = str(remote_nodeid.text()).strip()
|
connect_str = str(remote_nodeid.text()).strip()
|
||||||
self.parent.open_channel(connect_str, funding_sat, 0)
|
self.parent.open_channel(connect_str, funding_sat, 0)
|
||||||
|
|
|
@ -27,7 +27,7 @@ if TYPE_CHECKING:
|
||||||
HTLC_TIMEOUT_WEIGHT = 663
|
HTLC_TIMEOUT_WEIGHT = 663
|
||||||
HTLC_SUCCESS_WEIGHT = 703
|
HTLC_SUCCESS_WEIGHT = 703
|
||||||
|
|
||||||
LN_MAX_FUNDING_SAT = pow(2, 24)
|
LN_MAX_FUNDING_SAT = pow(2, 24) - 1
|
||||||
|
|
||||||
# dummy address for fee estimation of funding tx
|
# dummy address for fee estimation of funding tx
|
||||||
def ln_dummy_address():
|
def ln_dummy_address():
|
||||||
|
|
Loading…
Add table
Reference in a new issue