Commit Graph
11197 Commits
Author SHA1 Message Date
Roei Erez 65ab3dbfc8 server: better way to clean chainControl resources
In this commit the location of where chain control services
are stopped is shifted to be closer to the point they are started.
Stopping of two services: "wallet" and "feeEstimator" that are started
inside the "newChainControlFromConfig" was shifted from server.go to
the cleanup function.

In addition the chainView.Stop was also removed from the server.Stop as
it is already handled by the router, where it is being started.
2021-04-13 13:45:28 +03:00
Roei Erez becae748de server: stop sub systems in case of server failed to start.
In this commit every succesfull started sub system is tracked
and in case of a failure to complete the Start function all
these sub systems are stopped using a generic cleanup function.
2021-04-13 13:45:28 +03:00
Roei Erez 3223df74e5 channelnotifier+discover+invoices: return error in Stop functions
In order to be consistent with other sub systems an error is now
returned from the Stop functions.
This also allows writing a generic cleanup mechanism to stop all
sub systems in case of a failure.
2021-04-13 13:26:01 +03:00
Olaoluwa Osuntokun c998264578 Merge pull request #5108 from cfromknecht/sendtoroute-amp
channeldb+invoices: add spontaneous AMP receiving + sending via SendToRoute
2021-04-07 16:37:23 -07:00
Conner Fromknecht 730b718208 lntest: add AMP itest 2021-04-07 12:09:47 -07:00
Conner Fromknecht 888af51ab4 lntest: make buildRoute method on mppTestContext
This will be reused by the amp itest.
2021-04-07 12:09:47 -07:00
Conner Fromknecht 352ce10658 lnrpc: add UnmarshalAMP decoding 2021-04-07 12:09:47 -07:00
Conner Fromknecht 00581efec6 lnrpc: add AMPRecord to Hop 2021-04-07 12:09:43 -07:00
Conner Fromknecht cfa9e954c7 channeldb/invoice: allow creating AMP invoices w/o preiamge 2021-04-07 12:08:35 -07:00
Conner Fromknecht ea934e1be9 invoices: add TestSpontaneousAmpPayment
Adds a set of test cases that exercise the spontaneous AMP payment flow
with valid and invalid reconstructions, as well as with single and
multiple HTLCs. This also asserts that spontaneous AMP is gated behind
the existing AcceptKeysend flag.
2021-04-07 12:08:35 -07:00
Conner Fromknecht 90a255078d invoices: reconstruct AMP child preimages 2021-04-07 12:08:35 -07:00
Conner Fromknecht 2a49b59f4f channeldb/invoices: rigorously test updateHtlc for MPP/AMP scenarios 2021-04-07 12:08:35 -07:00
Conner Fromknecht 0b5be8576e channeldb/invoice: make Copy() a member of InvoiceHTLC 2021-04-07 12:08:35 -07:00
Conner Fromknecht 6780f74c87 channeldb/invoices: set AMP HTLC preimages when settling invoice 2021-04-07 12:08:35 -07:00
Conner Fromknecht 24d283e615 channeldb/invoice_test: only set htlc-level preimage on accept 2021-04-07 12:08:34 -07:00
Conner Fromknecht 88b72ab398 invoices: add processAMP 2021-04-07 12:08:34 -07:00
Conner Fromknecht 3fb70dd936 invoices: add checkSettleResolution and checkFailResolution
Also refactor existing unit tests to use them.
2021-04-07 12:08:34 -07:00
Conner Fromknecht 7e2f5a184b channeldb: validate feature dependencies when adding invoice 2021-04-07 12:08:34 -07:00
Conner Fromknecht 7bed359296 channeldb: refactor InvoiceRef.String() with all optional fields 2021-04-07 12:08:34 -07:00
Conner Fromknecht 174d577524 channeldb: make payhash on InvoiceRef optional
Currently we support queries by payHash or payHash+payAddr. For handling
of AMP HTLCs, we only need to support querying by payAddr.
2021-04-07 12:08:34 -07:00
Conner Fromknecht be6698447e channeldb/invoice: add InvoiceRefByAddr 2021-04-07 12:08:34 -07:00
Conner Fromknecht 438b03afa4 features: define temporary AMP feature bits 30/31 2021-04-07 12:08:34 -07:00
Conner Fromknecht c2729cbbbd htlcswitch/hop: parse and validate AMP records 2021-04-07 12:08:33 -07:00
Conner Fromknecht 135a0a9f7f htlcswitch/hop: make unknown required type const
Currently we use the AMP record type, this allows us to change it easily
as we add new known records. We also bump this to 0x0c instead of 0x0a.
2021-04-07 12:08:33 -07:00
Conner Fromknecht 82b4f11292 record/amp: use switch from 10 -> 14 for AMP TLV type
This is to not conflict with trampoline BOLT.
2021-04-07 12:08:33 -07:00
Conner Fromknecht 8fe4de88c1 record: convert child_index from uint16 to uint32 2021-04-07 12:08:29 -07:00
Johan T. Halseth 46c9140ac0 Merge pull request #5180 from GameXG/master2
lnd: fix #5179 panic: runtime error: invalid memory address or nil po…
2021-04-07 09:10:22 +02:00
GameXG f980bc38f1 fix #5179 extractPaymentIntent null pointer
payIntent.paymentAddr has not been initialized.
2021-04-07 10:41:31 +08:00
Johan T. Halseth d1c7059f14 Merge pull request #5178 from halseth/mobile-docker-prefix
make: pass mobile subserver prefix to docker when generating mobile RPC
2021-04-06 14:54:11 +02:00
Johan T. Halseth 173342a463 Merge pull request #5010 from halseth/walletunlocker-unify-mobile
[mobile] Allow state API on mobile, simplify callback mechanism
2021-04-06 13:35:03 +02:00
Johan T. Halseth 2868b22083 make: pass mobile subserver prefix to docker when generating mobile RPC 2021-04-06 12:52:27 +02:00
Johan T. Halseth 980beba985 mobile: return error in case lnd is already running 2021-04-06 11:38:37 +02:00
Johan T. Halseth 321141600e mobile/bindings: update API for falafel v0.8.1 2021-04-06 10:49:50 +02:00
Johan T. Halseth cf5b0b7943 mobile: include stateservice, use same listener for all services 2021-04-06 10:49:50 +02:00
Johan T. Halseth db28e7c891 lnd: consolidate WalletUnlocker- and AdminAuthOptions 2021-04-06 10:49:45 +02:00
Johan T. Halseth 8789247bf9 print current falafel version 2021-04-06 10:45:32 +02:00
Johan T. Halseth 2338a12729 Merge pull request #5172 from hsjoberg/state-small
lnrpc: Change State -> state in SubscribeStateResponse
2021-04-06 10:40:04 +02:00
Jonathan Underwood 786568fa46 cert: allow cert expiry to be set in config 2021-04-05 20:23:33 -07:00
Olaoluwa Osuntokun 1ccf6ed7d4 Merge pull request #5063 from Crypt-iQ/pprof_patch_03022021
lnd: optionally serve pprof on localhost for better security
2021-04-05 20:20:39 -07:00
Olaoluwa Osuntokun ca96e66b43 Merge pull request #5116 from joostjager/mc-deadlock
routing: fix mission control deadlock
2021-04-05 20:02:57 -07:00
Olaoluwa Osuntokun d8ecc16eb0 Merge pull request #5047 from wpaulino/import-account-or-pubkey
multi: support derived public key import
2021-04-05 19:41:11 -07:00
Wilmer Paulino 983f402369 itest: add wallet import cases 2021-04-05 15:41:12 -07:00
Wilmer Paulino cb3e179eaf rpc: break down wallet balance by accounts 2021-04-05 15:41:12 -07:00
Wilmer Paulino 4964801c6f lncli: add wallet import related commands 2021-04-05 15:41:11 -07:00
Wilmer Paulino 5301c7e83f walletrpc: expose wallet import related RPCs 2021-04-05 15:41:10 -07:00
Wilmer Paulino 2d163b788b lnwallet: expose wallet import related methods to WalletController 2021-04-05 15:41:09 -07:00
Wilmer Paulino c7bed34bca lncli: add account flag to wallet related commands 2021-04-05 15:41:08 -07:00
Wilmer Paulino a7211b34c3 rpc: expose account parameter for several wallet RPCs 2021-04-05 15:41:07 -07:00
Wilmer Paulino f91e7cde59 lnwallet: expose optional account filter for several WalletController methods 2021-04-05 15:41:06 -07:00
Wilmer Paulino f38bf4d7fa lnwallet: expose required account parameter for WalletController methods 2021-04-05 15:41:05 -07:00