ThomasV
6cc3480356
follow-up prev commit
4 years ago
ThomasV
16554afa1b
follow-up previous commit (this was for testing)
4 years ago
ThomasV
2e4f45ec74
use two trampolines: fix blacklisting, use local variables for trampoline_fee_level and use_two_trampolines
4 years ago
SomberNight
ec6baa12f8
follow-up prev
oops, that was just for local testing
4 years ago
SomberNight
064670bd75
network: close interfaces more aggressively (abort after 2 seconds)
fixes #7083
4 years ago
SomberNight
ff485cee62
use functools.wraps() for some wrappers
to help debugging
4 years ago
SomberNight
859f8ccf8e
fix wallet.clear_history()
it would result in "wallet.get_history() failed balance sanity-check"
maybe related: https://github.com/spesmilo/electrum/issues/6792
4 years ago
ThomasV
5a2a724cb9
Receive MPP: Use persisted payment status to decide whether to
fulfill HTLCs. Without this commit, we might timeout a part of
a payment if the client is shut down before all parts are
fulfilled.
4 years ago
SomberNight
e25602ab3b
wallet: don't put partial tx as UTXO into psbt
if there is a chain of unsigned txs, we cannot populate NON_WITNESS_UTXO
closes #7080
closes #7009
closes #6482
4 years ago
SomberNight
785fe6aeea
lnutil: (trivial) add ShortChannelID.from_str() method
for console use atm
4 years ago
ThomasV
738411e32b
Trampoline forwarding:
- fix regression in create_routes:
fwd_trampoline_onion was not added to the tuple
- fix onion structure for e2e
- maybe_fulfill_htlc:
check the mpp_status of the outer onion,
return trampoline_onion to be forwarded
4 years ago
ThomasV
ba4d6bc8b3
trampoline MPP: fix total_msat in trampoline onion, and bucketing
4 years ago
ThomasV
253907fb60
lnworker: move buckets logic inside first branch of if statement (refactoring commit)
4 years ago
SomberNight
f84f13529a
lnhtlc: fix deadlock
4 years ago
SomberNight
adbfb2dcc8
lnworker.pay_to_node: (fix) pass correct total_msat to pay_to_route
4 years ago
SomberNight
920e1e94fa
kivy: InvoiceDialog: make LN invoice QR code scannable
Don't show the text and the QR code together, only the QR code:
the text takes up too much space, which make the QR hard to scan.
4 years ago
SomberNight
1aec982b27
kivy: SendScreen: reliably show LN payment attempt progress for invoice
4 years ago
ThomasV
7ca64ebbd8
fix #7078
4 years ago
SomberNight
95b7c976e0
lnrouter.get_distances: fix exception due to rare race
if the graph is being updated while the pathfinding is running,
channel_info might be None here
4 years ago
ThomasV
3fa1aed8cd
add unit test for basic mpp
4 years ago
ThomasV
ca6ecd56f2
fix route for non-trampoline MPP
4 years ago
ThomasV
1adde4c54a
qt channels_list: use monospace font for channel capacity
4 years ago
ThomasV
6cf79dcfb2
qt: update all tabs when base_unit changes
4 years ago
ThomasV
222c70ada6
qt swap_dialog: use a single button to toggle direction
4 years ago
ThomasV
51f3c613a5
(minor) fix typos and indentation
4 years ago
SomberNight
44059ec116
lnpeer: more detailed logging in maybe_fulfill_htlc
4 years ago
SomberNight
9310e9023e
test_lnpeer: add test: multihop payment that routes around failure
This would have caught the overpayment bug fixed in
693583edc5
4 years ago
SomberNight
750d8cfab5
lnworker: run create_route_for_payment end-to-end, incl private edges
We pass the private edges to lnrouter, and let it find routes end-to-end.
Previously the edge_cost heuristics didn't apply to the private edges
and we were just randomly picking one of the route hints and use that.
So e.g. cheaper private edges were not preferred, but they are now.
PathEdge now stores both start_node and end_node; not just end_node.
4 years ago
SomberNight
4445cef033
lnutil: turn global forwarding fee params into Channel attributes
useful for unit testing, and it is the conceptually correct thing anyway
4 years ago
ThomasV
259dacd56f
Trampoline MPP aggregation:
- trampoline node is the final recipient of MPP
- each trampoline receives a bucket of HTLCs
- if a HTLC from a bucket fails, wait for the entire bucket to fail
- move trampoline route and onion code into trampoline module
4 years ago
ThomasV
2da90add8f
maybe_fulfill_htlc: add failure reason to logs
4 years ago
ThomasV
693583edc5
lnworker: amount passed in HtlcLog must be without fees
4 years ago
SomberNight
06ea06f7d3
_calc_routing_hints_for_invoice: incl max 15 chans to avoid qr overflow
Prioritise channels that are likely to be able to receive the payment.
4 years ago
SomberNight
6f894b9f88
_calc_routing_hints_for_invoice: also incl chans < invoice amount
now that we can receive MPP
4 years ago
SomberNight
1139720b58
lnworker: fix handle_error_code_from_failed_htlc for private channels
if the last (private) edge of the route errors, we need to try other route hints (if any)
4 years ago
SomberNight
b3b87555dc
qt/kivy: lightning_tx_dialog: show LN invoice
4 years ago
SomberNight
c3ae1c0965
android build: (trivial) build arm64 apk first
Build the apk I use to test with first :P
This is also the one mentioned in the README copy-paste code snippets.
4 years ago
SomberNight
a9185b0846
follow-up prev
kivy infers the type of the property from the default value.
without this, it was converting the str(Decimal(x)) to float
4 years ago
SomberNight
6094f2751e
kivy channel dialog: fix unit of displayed feerate
The amount shown was in sat/kw, incorrectly labeled as sat/kbyte.
Show sat/vbyte instead.
4 years ago
SomberNight
7d7dcf0795
qt/kivy ChannelsList: if node alias is unknown, display node id
instead of "unknown"
4 years ago
SomberNight
dd37151d65
qt ChannelsList: (trivial) format_fields should not know column order
4 years ago
SomberNight
bf7129d57e
synchronizer/verifier: ensure fairness between wallets (follow-up)
follow-up to 4346d2fc76
It's not just about the Synchronizer, the Verifier should not starve other jobs either...
(previously I thought the Verifier is not too important as it only makes
requests if there are new txs; however with LNWatcher its progress is not persisted)
4 years ago
SomberNight
e0cfb2179d
bech32: another around 10% speedup for bech32_decode
turns out stdlib ord() is somewhat slow;
also, only lookup data chars once
benchmarked with:
```
import time
import electrum
from electrum.segwit_addr import bech32_decode
electrum.constants.set_testnet()
inv = "lntb4m1p00zfpppp597ely08ffhk8n3emeswukt0y3qfvt3sj3ufkhnaatlrswj2xvwuqsp5vu3ezu44ka8arvgda44yalysp3k3edlvg56cjkk5lvu4e4anmdssdq2v9ekgctnvscqzynxqyz5vq9qypqsqrzjqv8shunq4nda8mw2mpxhtz8v03wlgug7sln2yvqklxym35ayz3erqxct8vqqqcqqqqqqqqlgqqqqqqgq9qrzjqdxvvgt048y4htef7r63r4ha9kctz3d6l3za0053ahe597wgrkc4gxct8cqqqfsqqqqqqqlgqqqqqqgq9qrzjqwyx8nu2hygyvgc02cwdtvuxe0lcxz06qt3lpsldzcdr46my5epmjxct8vqqqdcqqqqqqqlgqqqqqqgq9qrzjqf56jn5txtqqtepnd0ahg0qg5m5mavfajsx403rem9wgu6rue0de7xct8vqqqtgqqqqqqqlgqqqq86qq9qrzjq027z73uyyl7fy8pkrpcn7x0el82pz3fw974p2052de4uz4j5lqqxx49tuqqqwgqqqqqqqqqqqqqqqqqpurzjqfj34n62wztqjxl59w4drxekg04rrrtf08mdestwhtky84ds7ja0yxct8sqqq3qqqqqqqqlgqqqqqqgq9qrzjqd872t5c5r5a8ssmwelpkdccsyn9mrr40rpp7khad4jr3kssxj9nvx49vgqqqnqqqqqqqqlgqqqq05qqgcxwu0ervh6atmqmqv7pmenhmc207gncyj0mcxedpwm8f56y2yl3qpq6mzjak37ddmeayd9unektmffv5rq8dvlpgq00rmmdalda73yhgqep0zuz"
def f():
for _ in range(10000):
addr = bech32_decode(inv, ignore_long_length=True)
t0 = time.time()
f()
t1 = time.time()
print(f"{t1-t0:.4f}")
```
4 years ago
SomberNight
b83f7159a9
bech32: around 5% speedup for bech32_decode
useful for lnaddr.lndecode
4 years ago
SomberNight
d7597d96d0
lnaddr: 15x speedup for lndecode
benchmarked with:
```
import time
import electrum
from electrum.lnaddr import lndecode
electrum.constants.set_testnet()
inv = "lntb4m1p00zfpppp597ely08ffhk8n3emeswukt0y3qfvt3sj3ufkhnaatlrswj2xvwuqsp5vu3ezu44ka8arvgda44yalysp3k3edlvg56cjkk5lvu4e4anmdssdq2v9ekgctnvscqzynxqyz5vq9qypqsqrzjqv8shunq4nda8mw2mpxhtz8v03wlgug7sln2yvqklxym35ayz3erqxct8vqqqcqqqqqqqqlgqqqqqqgq9qrzjqdxvvgt048y4htef7r63r4ha9kctz3d6l3za0053ahe597wgrkc4gxct8cqqqfsqqqqqqqlgqqqqqqgq9qrzjqwyx8nu2hygyvgc02cwdtvuxe0lcxz06qt3lpsldzcdr46my5epmjxct8vqqqdcqqqqqqqlgqqqqqqgq9qrzjqf56jn5txtqqtepnd0ahg0qg5m5mavfajsx403rem9wgu6rue0de7xct8vqqqtgqqqqqqqlgqqqq86qq9qrzjq027z73uyyl7fy8pkrpcn7x0el82pz3fw974p2052de4uz4j5lqqxx49tuqqqwgqqqqqqqqqqqqqqqqqpurzjqfj34n62wztqjxl59w4drxekg04rrrtf08mdestwhtky84ds7ja0yxct8sqqq3qqqqqqqqlgqqqqqqgq9qrzjqd872t5c5r5a8ssmwelpkdccsyn9mrr40rpp7khad4jr3kssxj9nvx49vgqqqnqqqqqqqqlgqqqq05qqgcxwu0ervh6atmqmqv7pmenhmc207gncyj0mcxedpwm8f56y2yl3qpq6mzjak37ddmeayd9unektmffv5rq8dvlpgq00rmmdalda73yhgqep0zuz"
def f():
for _ in range(100):
addr = lndecode(inv)
t0 = time.monotonic()
f()
t1 = time.monotonic()
print(f"{t1-t0:.4f}")
```
4 years ago
SomberNight
2b693d3498
tests: fix test_lnpeer.test_payment_race
broke in b6b13217b4
see changes to lnworker.htlc_fulfilled
4 years ago
ThomasV
bc1ec6ac34
Qt: fix running GUI offline
4 years ago
ThomasV
5175a97671
test_payment_race: increase delay
4 years ago
ThomasV
f32d49b8ca
revert 'keep invoice INFLIGHT', check HTLCs before payment attempt
4 years ago
ThomasV
38652cffb0
fix test_lnpeer (follow-up prev commit)
4 years ago