Commit Graph

4291 Commits

Author SHA1 Message Date
Janus
3a7f6b0186 lnbase: move channel commitment number increment to function 2018-06-26 19:30:08 +02:00
Janus
cf615eb65e lnbase: receive repeated payments 2018-06-26 19:30:08 +02:00
Janus
510e3e4662 tests: don't use default lightning_peers in online test 2018-06-26 19:30:08 +02:00
Janus
6b1451b566 lnbase: channel reestablishment working 2018-06-26 19:30:08 +02:00
SomberNight
d5333a2a2d bolt-04: implement processing of onion packets 2018-06-26 19:30:08 +02:00
SomberNight
5824a0a790 minor clean-up of prev. util.xor_bytes 2018-06-26 19:30:08 +02:00
SomberNight
1d75df5509 implement bolt-04 onion packet construction 2018-06-26 19:30:08 +02:00
Janus
9134aa30e4 lnbase: save channel details in wallet, enable running online test with reestablishment_mode 2018-06-26 19:30:08 +02:00
Janus
b57d07c294 lnbase: move waiting for funding_locked to new function, make function for signing and sig conversion 2018-06-26 19:30:08 +02:00
Janus
4d1bffdc7a lnbase: make function for building htlc_tx depending on if it is for_us/we_receive 2018-06-26 19:30:08 +02:00
Janus
3d8e560c1f lnbase: verify their htlc signature 2018-06-26 19:30:08 +02:00
ThomasV
44e7d06b34 lnbase: standardize to_bytes calls 2018-06-26 19:30:08 +02:00
Janus
507ff4eea1 lnbase: fix custom local to_self_delay, use node privkey derived from timestamp in online test 2018-06-26 19:30:08 +02:00
Janus
558727e1f3 test_lnbase_online: pass password=None to channel_establishment_flow 2018-06-26 19:30:08 +02:00
Janus
fd5f66b8af lnbase: avoid copying variables, insert newlines 2018-06-26 19:30:08 +02:00
ThomasV
f20a935bef lnbase: derive keys from wallet keystore 2018-06-26 19:30:08 +02:00
Janus
83fbb1a248 lnbase: avoid local variables, remote useless comments, name basepoints as such 2018-06-26 19:30:08 +02:00
Janus
d5e464c29e lnbase: set new field in Transaction instead of returning a tuple in make_commitment 2018-06-26 19:30:08 +02:00
Janus
e53a8107e4 lnbase: set to_self_delay back to 144, defer cltv_expiry problem 2018-06-26 19:30:08 +02:00
Janus
ef0de2a77c lnbase: use correct delay 2018-06-26 19:30:08 +02:00
Janus
0cb722ae3a lnbase: avoid code duplication, return htlc outpoint dict in make_commitment 2018-06-26 19:30:08 +02:00
Janus
28593d703d lnbase: simplify commitment transaction building with open channel 2018-06-26 19:30:08 +02:00
Janus
7a5eb7c9d7 lnbase: organize channel data 2018-06-26 19:30:08 +02:00
Janus
881181a3f2 lnbase: allow passing KeypairGenerator to channel_establishment_flow, fix derive_privkey 2018-06-26 19:30:08 +02:00
Janus
3d60e9d631 lnbase: receiving invoice payment works 2018-06-26 19:30:08 +02:00
Janus
75a004eea1 lnbase: commitment_signed, revoke_and_ack now accepted without errors 2018-06-26 19:30:08 +02:00
SomberNight
81d94a7253 bitcoin.py: SCRIPT-related clean-up. transaction.py: construct_witness 2018-06-26 19:30:08 +02:00
Janus
0ff942c3c8 lnbase: fix their new commitment transaction (htlc tx construction still incorrect) 2018-06-26 19:30:08 +02:00
ThomasV
ac70a10856 lnbase: fix bug in message parsing 2018-06-26 19:30:08 +02:00
ThomasV
5bb310ac10 follow up b5eb7dd7683f24f03c80ab8f612658b5f3966eb1 2018-06-26 19:30:08 +02:00
Janus
64be96fb8a lnbase: attempt at making htlc_signature to send (currently remote fails due to wrong num_htlcs in commitment_signed) 2018-06-26 19:30:08 +02:00
ThomasV
cf677d1f1c simplification 2018-06-26 19:30:08 +02:00
Janus
08d187c650 lnbase: add TODO explaining how to verify htlc_signature given to us 2018-06-26 19:30:08 +02:00
Janus
2bcb294fb3 lnbase: verification of new local commitment working 2018-06-26 19:30:08 +02:00
Janus
30b1416807 lnbase: derive next keys when making updated local commitment transaction 2018-06-26 19:30:08 +02:00
Janus
ee4673c0e9 lnbase: try to receive payment, work on commitment tx with htlcs 2018-06-26 19:30:08 +02:00
Janus
21744f5d68 lnbase: handle commitment transaction update (receive funds, not working yet) 2018-06-26 19:30:08 +02:00
Janus
f962457b9f simnet/testnet support in bolt11, set max-htlc-value-in-flight 2018-06-26 19:30:08 +02:00
SomberNight
32e35e9010 transaction.py: sign_txin. allow override for get_preimage_script.
test_commitment_tx_with_all_five_HTLCs_untrimmed_minimum_feerate now passes
2018-06-26 19:30:08 +02:00
ThomasV
3051b1a33e redundant: you subscribed only to 'updated' 2018-06-26 19:30:08 +02:00
ThomasV
dc45467c46 follow-up prev commit 2018-06-26 19:30:08 +02:00
ThomasV
93e526a952 lnbase: verify remote signature 2018-06-26 19:30:08 +02:00
SomberNight
cb312538dc channel_establishment_flow: use get_per_commitment_secret_from_seed 2018-06-26 19:30:08 +02:00
Janus
e92c468e91 lnbase: improve htlc_tx generation (only localsig wrong) 2018-06-26 19:30:08 +02:00
SomberNight
3108e0bf81 get_per_commitment_secret_from_seed: small clean-up 2018-06-26 19:30:08 +02:00
Janus
8fe28bae03 fix derive_secret 2018-06-26 19:30:08 +02:00
SomberNight
2897ea9870 get_per_commitment_secret_from_seed (not working yet) 2018-06-26 19:30:08 +02:00
Janus
35cba497f4 lnbase: avoid race while waiting for funding_locked, wait for un-reversed hash 2018-06-26 19:30:08 +02:00
Janus
22e86d89e5 complete bolt11 port to ecdsa instead of secp256k1 2018-06-26 19:30:08 +02:00
SomberNight
205ee0019a channel_establishment_flow: wait for confirmations of funding txn 2018-06-26 19:30:08 +02:00
ThomasV
1aac0835d4 add processing flow for funding_locked 2018-06-26 19:30:08 +02:00
ThomasV
0c5a65285c lnbase: fix parameters to make_commitment in htlc test 2018-06-26 19:30:08 +02:00
SomberNight
58c5cd3e0d transaction.py: shortcut witness/scriptSig serialisation 2018-06-26 19:30:08 +02:00
Janus
22eeda2b84 lnbase: add some comments 2018-06-26 19:30:08 +02:00
SomberNight
2f684d99b1 constants.py: Simnet inherits from Testnet 2018-06-26 19:30:08 +02:00
Janus
0e9f18adfc use same servers for simnet as for regtest 2018-06-26 19:30:08 +02:00
Janus
3cdf10c7bf lightning-hub: update rpc stubs, do not ignore them in gitignore 2018-06-26 19:30:08 +02:00
ThomasV
0b8add104b lnbase: fix initial commitment transaction 2018-06-26 19:30:08 +02:00
SomberNight
2d3387b24e refactor storage of channels, path finding 2018-06-26 19:30:08 +02:00
Janus
9c38e42a7d avoid duplicating bech32 module 2018-06-26 19:30:08 +02:00
Janus
355b526db9 lnbase: more work on make_htlc_tx 2018-06-26 19:30:08 +02:00
Janus
0da15f6dff lnbase: make_htlc_tx 2018-06-26 19:30:08 +02:00
ThomasV
bd90f8b77e fix: use remote_per_commitment_point 2018-06-26 19:30:08 +02:00
ThomasV
f5d9f79e65 lnbase: derive blinded pubkey 2018-06-26 19:30:08 +02:00
ThomasV
c0b624e73a lnbase: fix variable name 2018-06-26 19:30:08 +02:00
ThomasV
7471c60f2f lnbase: add privkey derivation 2018-06-26 19:30:08 +02:00
ThomasV
5d2be9edab add test for key derivation 2018-06-26 19:30:08 +02:00
ThomasV
06e52b0b63 lnbase: key derivation (WIP) 2018-06-26 19:30:08 +02:00
Janus
14ee54fb51 lnbase: test signing of first htlc test case 2018-06-26 19:30:08 +02:00
Janus
87c0ff4654 lnbase: make_received_htlc 2018-06-26 19:30:08 +02:00
ThomasV
65c0ee5f4b fix hash in make_offered_htlc 2018-06-26 19:30:07 +02:00
ThomasV
1082232136 cleanup lnbase tests 2018-06-26 19:30:07 +02:00
Janus
baacbe456a lightning-hub: remove path hack, use relative imports 2018-06-26 19:30:07 +02:00
SomberNight
620e8d60aa naive route finding 2018-06-26 19:30:07 +02:00
Janus
6f63672550 lnbase: offered htlc script construction 2018-06-26 19:30:07 +02:00
ThomasV
d94115ab80 use acceptable variable names 2018-06-26 19:30:07 +02:00
ThomasV
d34c902776 lightning: separate testing from main code 2018-06-26 19:30:07 +02:00
ThomasV
945877a5e1 lightning: store network view 2018-06-26 19:30:07 +02:00
ThomasV
354f75592e lnbase: parse ipv6, fix transport bug 2018-06-26 19:30:07 +02:00
ThomasV
bf4adbde88 lnbase: fix read_message, reduce verbosity 2018-06-26 19:30:07 +02:00
ThomasV
c95a20c701 lnbase: implement key rotation, request initial sync in localfeatures 2018-06-26 19:30:07 +02:00
ThomasV
530d4b5e58 lnbase: verify signature in node_announcement 2018-06-26 19:30:07 +02:00
SomberNight
a3eb4f8e17 bitcoin.py: implement add_number_to_script. fix CSV arg in make_commitment. 2018-06-26 19:30:07 +02:00
ThomasV
ff0cf94330 lnbase: fix test 2018-06-26 19:30:07 +02:00
SomberNight
b04cabe0ef implement script_num_to_hex. fix encoding of argument for CSV in make_commitment 2018-06-26 19:30:07 +02:00
SomberNight
d4b4d1113d fixes for make_commitment, but still incorrect destination address (csv arg?) 2018-06-26 19:30:07 +02:00
ThomasV
64726fbb26 lnbase: fix tx amounts 2018-06-26 19:30:07 +02:00
Janus
ff4b9be3af lightning-hub: include ln relative to current directory 2018-06-26 19:30:07 +02:00
Janus
f7742dbf3c lnbase_test: add first commitment tx with 5 htlcs test 2018-06-26 19:30:07 +02:00
ThomasV
2f9a71a7ed lnbase: fix locktime and nsequence 2018-06-26 19:30:07 +02:00
Janus
7f96a60a03 lnbase_test: insert remote_signature and compare fields independently 2018-06-26 19:30:07 +02:00
ThomasV
690c92a54a lnbase: create unit test for commitment tx 2018-06-26 19:30:07 +02:00
Janus
9e013d4ce0 network: stop loop on loop thread 2018-06-26 19:29:39 +02:00
ThomasV
24b619edee lnbase: fix signature index 2018-06-26 19:29:39 +02:00
ThomasV
efe6450444 lnbase: initial commitment transaction 2018-06-26 19:29:39 +02:00
ThomasV
f8d868e89a lnbase: fix funding address, funding_output_index 2018-06-26 19:28:29 +02:00
ThomasV
812e9fcca6 follow up 1aac9e59ed957898fceef99b29b9cc17d7843569 2018-06-26 19:28:29 +02:00
ThomasV
17a9c8e417 lnbase: communication privkey belongs to peer 2018-06-26 19:28:29 +02:00
Janus
2dc8f5efe8 lightning: fix hub backend loop availability 2018-06-26 19:28:29 +02:00
Janus
ed7961c0ce lnbase: more parts of channel establishment 2018-06-26 19:28:29 +02:00
Janus
ce5ae70d20 lnbase: remove unnecessary try/except 2018-06-26 19:28:29 +02:00
Janus
dc934ce9e5 lnbase: lnbase_test must use threadsafe task submission 2018-06-26 19:28:29 +02:00
ThomasV
9a2fba81e7 lnbase: decorator that handles exceptions 2018-06-26 19:28:29 +02:00
Janus
d45a6a5069 lnbase: fix shutdown when lnbase has exception in main_loop 2018-06-26 19:28:29 +02:00
Janus
89850de99b lnbase: print exceptions from main_loop 2018-06-26 19:28:29 +02:00
Janus
470d6071ea lnbase: initialize loop variable in main 2018-06-26 19:28:29 +02:00
Janus
6b044bf2ae network: do not acquire lightninglock for lnbase 2018-06-26 19:28:29 +02:00
Janus
5e0def63c6 lnbase: add lnbase_test 2018-06-26 19:28:29 +02:00
ThomasV
37d73c3165 lnbase: expose wallet object in LNWorker 2018-06-26 19:28:29 +02:00
Janus
51a31051bd lnbase: merge initialize and main_loop 2018-06-26 19:28:29 +02:00
Janus
7fb777828a lnbase: handle error during channel establishment 2018-06-26 19:28:29 +02:00
Janus
abe436fa9a lnbase: channel establishment flow, avoid using Wallet instance 2018-06-26 19:28:29 +02:00
ThomasV
3869463f62 lnbase: use relative imports 2018-06-26 19:28:29 +02:00
Janus
2b6c550aee lnbase: support simnet/testnet, create accepted open_channel message 2018-06-26 19:28:29 +02:00
Janus
09141f6767 lnbase: use valid pubkeys in open_channel 2018-06-26 19:28:29 +02:00
Janus
29b8ba95c9 lnbase: try sending open_channel 2018-06-26 19:28:29 +02:00
ThomasV
4836aefbe8 lnbase: add draft handlers 2018-06-26 19:28:29 +02:00
Janus
d2493457ac lnbase: avoid reimplementing int.to_bytes 2018-06-26 19:28:29 +02:00
Janus
27132ec4dd lnbase: avoid reimplementing int.from_bytes 2018-06-26 19:28:29 +02:00
ThomasV
48dae8fadf fix asyncio loop 2018-06-26 19:28:29 +02:00
Janus
a8320ef6f5 lnbase: do not catch all exceptions, tolerate calculations with variables from kwargs 2018-06-26 19:28:29 +02:00
ThomasV
c4d20e0ce8 integrate lnbase with network 2018-06-26 19:28:29 +02:00
ThomasV
411f188daf lnbase: process ping messages 2018-06-26 19:28:29 +02:00
ThomasV
ca532df193 lnbase: create main loop 2018-06-26 19:28:29 +02:00
ThomasV
c5fdf0d8ba lnbase: save buffer for next read 2018-06-26 19:28:29 +02:00
ThomasV
35fb996a8a lnbase: Peer class 2018-06-26 19:28:29 +02:00
ThomasV
339b1778f7 lnbase: fix json loading and indentation 2018-06-26 19:28:29 +02:00
Janus
9a343e0cd2 lightning: do not list python files as resources, use lightning spec generated serialization 2018-06-26 19:28:29 +02:00
ThomasV
26c09a84e4 lightning network base 2018-06-26 19:28:29 +02:00
Janus
2a26544bb4 lightning: qt channel dialog, fix for shutdown when lightning disabled 2018-06-26 19:28:29 +02:00
Janus
1a04eb3ae4 kivy: paste test seed using xclip, lightning: do not catch BaseException unnecessarily, fix clearSubscribers, detect passworded wallet correctly 2018-06-26 19:28:29 +02:00
ThomasV
bbb9911904 simplify parameters, add lndhost to config 2018-06-26 19:28:29 +02:00
Janus
18aaf674c3 lightning: add --simnet and --lightning switches 2018-06-26 19:28:29 +02:00
Janus
6f4ac2779b lightning: assert result type, add invoice qr dialog 2018-06-26 19:27:04 +02:00
Janus
b0fdec3d6d lightning: kivy: open channel button in invoice 2018-06-26 19:27:04 +02:00
Janus
81ab10d6e2 lightning: python3.5 compat 2018-06-26 19:26:38 +02:00
Janus
54bf3c2bc9 lightning: add missing import, set console to none initially 2018-06-26 19:26:38 +02:00
Janus
c9f7c4026f lightning: do not require lock for broadcast tx, it is thread-safe 2018-06-26 19:26:38 +02:00
Janus
8601e7cb7e lightning: save key derivation point 2018-06-26 19:26:38 +02:00
Janus
727b04ffa2 lightning: separate thread for publish transaction 2018-06-26 19:26:38 +02:00
Janus
6a3118c42f lightning: use queueing lock 2018-06-26 19:26:38 +02:00
Janus
f5e3da3e56 lightning: less junk on console, quicker shutdown 2018-06-26 19:26:38 +02:00
Janus
155f62f7d4 lightning: don't receive too much data, workaround by reading byte by byte 2018-06-26 19:26:38 +02:00
Janus
a10365e6de lightning: fix syntax 2018-06-26 19:26:38 +02:00
Janus
fdd47454f3 lightning: complete moving of lightning objects, acquire net/wallet lock while answering lightning requests 2018-06-26 19:26:07 +02:00
Janus
6fe733a8f9 lightning: misc patches, launch asyncio loop on separate thread 2018-06-26 19:24:26 +02:00
Janus
a9444e02a9 lightning: march 2018 rebase, without integration 2018-06-26 19:24:26 +02:00
ThomasV
f24a449d37
Merge pull request #4463 from maschwanden/master
Daemon: Fix preflight CORS request handling
2018-06-26 17:09:13 +02:00
SomberNight
4dcefa7d3b
network: fix fork detection in certain backward search cases
if there are no checkpoints and the split is very old, the exponential backward search might undershoot so that it asks for the genesis block but 0 and None are not distinguished hence the fork detection logic fails
2018-06-26 16:56:30 +02:00
ThomasV
5a5502303f make add_signature_to_txin an instance method 2018-06-26 13:09:02 +02:00