Commit Graph

894 Commits

Author SHA1 Message Date
Bjarne Magnussen
48c773ec87
lnrpc: add DestOutput information to RPC GetTransactions 2022-03-23 11:29:09 +01:00
Bjarne Magnussen
188b39268d
lnrpc: add DestOutput to the protobuf 2022-03-23 11:29:09 +01:00
Oliver Gugger
57840bba36
Merge pull request #6232 from bottlepay/require-interceptor
htlcswitch: add an always on mode to htlc interceptor
2022-03-19 10:47:22 +01:00
Olaoluwa Osuntokun
4ecd153be2
lnrpc: add new locked balance field for WalletBalance
In this commit, we add a new field to the WalletBalance call that
permits users to account for the set of outputs that may be locked due
to a pending transaction. Without this field any time users locked
outputs for things like PSBT signing, then they disappear from the
WalletBalance call, which may cause a panic.
2022-03-17 16:36:44 -07:00
Olaoluwa Osuntokun
f13399bc49
Merge pull request #6190 from ErikEk/listunspent-deafult-values
walletrpc: add default values to listunspent
2022-03-16 16:16:45 -07:00
Joost Jager
169f0c0bf4
routerrpc+htlcswitch: move intercepted htlc tracking to switch
In this commit we move the tracking of the outstanding intercepted htlcs
to InterceptableSwitch. This is a preparation for making the htlc
interceptor required.

Required interception involves tracking outstanding htlcs across
multiple grpc client sessions. The per-session routerrpc
forwardInterceptor object is therefore no longer the best place for
that.
2022-03-15 08:44:57 +01:00
Oliver Gugger
95c270d1f8
Merge pull request #6217 from liviu-ln/psbt-finalize-check
walletrpc: return an error when finalizing an already complete PSBT
2022-03-14 10:45:24 +01:00
Oliver Gugger
7dfe4018ce
multi: use btcd's btcec/v2 and btcutil modules
This commit was previously split into the following parts to ease
review:
 - 2d746f68: replace imports
 - 4008f0fd: use ecdsa.Signature
 - 849e33d1: remove btcec.S256()
 - b8f6ebbd: use v2 library correctly
 - fa80bca9: bump go modules
2022-03-09 19:02:37 +01:00
ErikEk
74db83bbfb walletrpc: add default values to listunspent 2022-02-17 10:05:16 +01:00
Oliver Gugger
13f187046b
multi: fix issues reported by whitespace linter 2022-02-15 16:26:08 +01:00
Oliver Gugger
895a2e497b
multi: formatting and comment fixes 2022-02-10 11:02:02 +01:00
Oliver Gugger
dfdc2bff8b
multi: run gosimports 2022-02-10 11:02:01 +01:00
carla
0092c731e5
lnrpc: limit hop hint selection in both passes by amount + count
Previously, we'd always add up to the maximum number of hop hints
(and beyond!) when selecting hop hints in our first pass. This
change updates hop hint selection to always stick to our hop hint
limit, and to the "hop hint factor" that we scale our invoices by.

This change will result in selecting fewer channels in our first
pass if their total inbound capacity reaches our hop hint factor.
This prevents us from revealing as many private channels as
before, but has the downside of providing fewer options for
payers.
2022-02-07 09:04:30 +02:00
carla
5836d58a99
lnrpc: add unit test covering too many hop hints 2022-02-07 09:03:10 +02:00
Olaoluwa Osuntokun
80e304573c
lnwallet: increase legacy fee limit threshold to 1k sats
In this commit, we increase the legacy fee limit threshold (the amount
below which we'll allow 100% of funds to go to fees for the non-v2 RPC
calls) from 50 sats to 1k sats.
2022-02-03 11:54:01 -08:00
Oliver Gugger
d22f543906
lnrpc: use amount based default routing fee 2022-02-02 14:24:53 +01:00
Joost Jager
e2b56f212f
htlcswitch: accept failure reason for intercepted htlcs 2022-02-01 17:18:59 +01:00
Oliver Gugger
a5849bb189
devrpc: remove lncli API docs tag [skip ci]
The API doc generator failed after merging #6149 because of the `lncli
importgraph` tag in the proto file.
We could also fix the API doc generator by adding the "dev" build tag,
but not including any dev only features in the API docs is probably the
preferred path.
2022-01-31 13:05:27 +01:00
Liviu
e11c41ba8f walletrpc: return an error when finalizing an already complete PSBT
Return an error to the client if attempting to finalize a PSBS with no missing signatures.
2022-01-30 21:37:32 -08:00
Oliver Gugger
b77c1fb200
Merge pull request #6149 from bhandras/graph_import_rpc
lnd: add `devrpc` sub server and `devrpc.ImportGraph` to import graph dumps
2022-01-28 10:24:59 +01:00
carla
714a1fb05c
invoicerpc: move hop hint to constant and add tests to select hop hint 2022-01-27 15:09:21 +02:00
carla
80bf4bf014
invoicerpc: return hop hints from select hop hint rather than functions
Update SelectHopHints to return a set of hop hints that can be
converted to route hints / functional options by the caller. This
change allows external code to call SelectHopHints to get a set of
route hints and use them as it likes, rather than limiting the
return value to functional options for invoice creation.
2022-01-27 15:09:20 +02:00
carla
00a47740c8
invoicesrpc: pass in specialized config for select hop hints 2022-01-27 15:09:19 +02:00
carla
56e83de9ef
invoicesrpc: add HopHintInfo decoupling hop hint from channel internals 2022-01-27 15:09:18 +02:00
ErikEk
ef1eff1058 lnrpc: fix the existing routing fee inaccuracy
When updating the channel routing policy, we encounter an inaccurate
precision error when calculating the routing fee. The issue stems from
the way the IEEE 754 standard works.

The solution here is to add a uint64 parameter (as mentioned in the
issue) and keep the float64 fee_rate parameter but rounding the product
of the base and fee rate.
2022-01-25 15:42:57 -08:00
Andras Banki-Horvath
eeea141e01
lnd: allow large GRPC messages 2022-01-24 17:43:00 +01:00
Andras Banki-Horvath
1a8f094503
lnrpc: add the devrpc development only subserver + devrpc.ImportGraph
This commits adds the devrpc package which implements a subserver that
adds clean separation for RPC calls useful for development and
debugging. This subserver is only compiled in if the dev tag is set.
Furthermore the commit adds the devrpc.ImportGraph call which can
import a graph dump obtained from another node by calling DescribeGraph.
Since the graph dump does not include the auth proofs, the imported
channels will be considered private.
2022-01-24 17:42:59 +01:00
Dimitris Apostolou
530a2059e5
multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
Andras Banki-Horvath
23c157a07b
routing: add option to force import MC pair history
This commit adds the `force` flag to the `XImportMissionControl` RPC
which allows skipping rules around the pair import except for what is
mandatory to make values meaningful. This can be useful for when clients
would like to forcibly override MC state in order to manipulate routing
results.
2022-01-19 17:18:05 +01:00
mads krogh
1e3c05399c lnd+lnrpc: add private status to pendingchannels response 2022-01-18 09:42:14 +01:00
Oliver Gugger
ed511bb37f
Merge pull request #6146 from yyforyongyu/add-closing-txid
rpcserver: add closing txid in PendingChannels' WaitingCloseChannel
2022-01-12 13:23:16 +01:00
yyforyongyu
99378b22c3
rpcserver: add closing txid in WaitingCloseChannel 2022-01-07 18:21:02 +08:00
Oliver Gugger
8994d86a1d
walletrpc+itest: add SignPsbt RPC 2022-01-06 14:35:07 +01:00
Oliver Gugger
1902ad724e
signrpc: remove incomplete sentence and TODO
We use SignOutputRaw which expects a witness script being set, even for
P2WKH. There is a special case in SignOutputRaw for the case where the
script is a p2wkh script, then the input script is reconstructed
correctly for the sighash.
2022-01-06 13:24:30 +01:00
Oliver Gugger
9da8333a6e
multi: fix formatting 2022-01-06 13:24:30 +01:00
yyforyongyu
df2ecd6bc5
invoices: refactor invoice subscriptions to avoid blocking
This commit fixes a potential blocking when notifying invoice updates.
When a new subscription client is created followed by an immediate
cancel, it's likely the client will be removed from the registry's
map(noop) and then added to its map again. This subscription will then
be kept in registry until lnd is restarted. Another more serious issue
is when multiple subscriptions are made for the same invoice, when the
above case happens, other subscriptions may never send invoice updates
because a previous client has a stopped notification queue that blocks
following notifications.
2021-12-15 02:38:51 +08:00
Bjarne Magnussen
93e5de9306
lnrpc: refactor populating lnrpc.Transaction inside SubscribeTransaction 2021-12-10 08:26:16 +01:00
kon
59b215fe09 routerrpc: fix wrong error messages
when payment_hash or final_cltv_delta and payment_request was set, the error message showed that the parameters shouldn't be set with dest instead of payment_request

[skip ci]
2021-12-09 10:36:32 +01:00
yyforyongyu
53e02fa83d
rpcserver: expose ChanStatusFlags in pending close
This commit exposes the ChanStatusFlags inside waitingCloseResp such
that the channel close type is exposed.
2021-12-08 04:50:23 +08:00
naveen
b3ef3db0f2
multi: Remove GO111MODULE env variable in Makefile
The `GO111MODULE` variable is not required from go 1.16
https://go.dev/blog/go116-module-changes
2021-11-30 09:35:30 +01:00
Olaoluwa Osuntokun
e94ddf7b17
build: bump release+build version to Go 1.17.3 2021-11-15 17:29:02 -08:00
Oliver Gugger
9a28a4a9ff
lnrpc+rpcperms+lntest: add unique MW message ID
This commit adds a new unique intercept message ID that is different for
each message sent to an RPC middleware. This will allow us to re-purpose
the existing request ID field into its original intention, which was to
have a unique ID for a full gRPC request/response pair or gRPC stream as
a whole.
2021-11-08 15:00:29 +01:00
Oliver Gugger
32101db873
Merge pull request #5916 from blastshielddown/docs_5899
lnrpc: add public key detail to signrpc KeyDescriptor [skip ci]
2021-11-02 15:03:14 +01:00
Michael Rhee
7c18fb64ae lnrpc: add public key detail to signrpc KeyDescriptor [skip ci]
Clarification that KeyDescriptor describes the public key in
raw_key_bytes and the key_loc identifies the private key. Helps
clarify responses from calls like DeriveKey and DeriveNextKey from
WalletKit.

Fixes #5899
2021-11-02 07:57:12 -05:00
Olaoluwa Osuntokun
66ca2a994b
Merge pull request #5901 from Roasbeef/dedup-interceptor
Dedup interceptor
2021-10-28 17:44:49 -07:00
Roei Erez
fe44aedb25
itest: dedup interceptor packets
Aded a test for the dedup intercepted packets of htlc interceptor.
2021-10-28 16:16:55 -07:00
Roei Erez
1f1b33bf85
routerrpc: de-duplicate htlc held by interceptor
This commit ensures htlcs currently held by the interceptor
Are not sent again. This prevents potential races in the user code that
may lead to loosing funds.
2021-10-28 16:16:50 -07:00
Olaoluwa Osuntokun
698b5a8079
lnrpc: populate new AmpInvoiceState field in CreateRPCInvoice 2021-10-28 15:50:20 -07:00
Olaoluwa Osuntokun
d8ce00e016
lnrpc/invoicesrpc: expose new lookup modifier to LookupInvoiceV2 2021-10-28 15:50:17 -07:00
Olaoluwa Osuntokun
8299d632e8
lnrpc/invoicesrpc: add new invoice ref LookupInvoiceV2 method
In this commit, we add a new `LookupInvoiceV2` method attached to the
invoice RPC sub-server. Compared to the existing version, this version
allows an invoice to be looked up by an invoice ref. This enables users
to query an AMP invoice based on a specific _set ID_, so they can get
the information related to the set of cumulative settles to that
invoices.
2021-10-28 15:49:25 -07:00