Commit Graph

454 Commits

Author SHA1 Message Date
ErikEk
6884fe40db Set private setting for invoice 2018-11-26 09:05:37 +01:00
Olaoluwa Osuntokun
a1c39af313
rpc: properly set output index in OpenChannelSync resp
Fixes #2219
2018-11-25 21:13:00 -06:00
Tom Kirkpatrick
b3c78d7110
queryroutes: set queryroutes numRoutes param default to 10
Fix an inconsistency between the gRPC/CLI queryroutes implementations.
Ensure that the numRoutes param always defaults to 10.
2018-11-17 13:35:59 +01:00
Johan T. Halseth
776059bdab
Merge pull request #2155 from joostjager/return-tx
lnwallet: update to new SendOutputs signature
2018-11-13 16:39:54 +01:00
Joost Jager
e14678030c
lnwallet: update to new SendOutputs signature 2018-11-10 07:57:19 +01:00
Xavi Soler
5fad3d1fbe rpcserver: show inactive channels in GetInfo 2018-11-05 09:10:32 +01:00
Joost Jager
28ae028535
lnrpc: accept pubkey in hop message
By passing a pubkey into SendToRoute, it becomes unnecessary for lnd to
query the channel graph to retrieve the hop pubkey. This allows routes
over private channels that are not present in the graph.
2018-11-01 08:59:53 +01:00
Joost Jager
e55a678eda
lnrpc: extract hop unmarshall code 2018-10-29 13:21:52 +01:00
Wilmer Paulino
e87d61b7f7
rpc: ensure we don't leak unadvertised nodes within invoice routing hints
In this commit, we ensure that we don't include routing hints for
unadvertised nodes at the time of invoice creation. Otherwise, this
would lead us to leak these unadvertised nodes to anyone who can get
their hands on the invoice being created. To prevent this, we'll now
look at the network graph and ensure that the node in unadvertised if
all of their edges are unadvertised and only extend to us.
2018-10-24 19:20:01 -07:00
Olaoluwa Osuntokun
1b0d8e8f13
Merge pull request #2059 from wpaulino/openchannel-unconfirmed-funds
rpc: prevent spending unconfirmed funds within OpenChannel by default
2018-10-23 19:58:43 -07:00
Olaoluwa Osuntokun
fbd91feace
Merge pull request #1888 from joostjager/routestruct
lnrpc+routing: fix unmarshallRoute and simplify route structure
2018-10-23 17:07:23 -07:00
Wilmer Paulino
3ac2e8486e
rpc: prevent spending unconfirmed funds within OpenChannel by default
In this commit, we address a slight regression in the defaults provided
by the OpenChannel RPC with regards to spending unconfirmed outputs to
fund funding transactions. We now add a new boolean parameter to
OpenChannelRequest: SpendUnconfirmed. If set, we'll use this to
indicate to the server that the funding transaction of the channel to be
created can spend the wallet's unconfirmed outputs to fund it. This
addition is needed because otherwise, if the caller doesn't specify a
MinConfs parameter to the request, then a default of 0 will be used,
which is not ideal.
2018-10-18 16:49:24 -07:00
Olaoluwa Osuntokun
4c0ca37174
Merge pull request #1389 from Bluetegu/noprivate-describegraph-1037
Add --noprivate flag to describegraph rpc to filter out private channels
2018-10-16 20:01:35 -07:00
Joost Jager
18d38d1d11
lnrpc: fix unsafe stream send 2018-10-15 21:13:37 +02:00
Joost Jager
a779004a18
lnrpc+routing: fix issues with missing data in unmarshallRoute
In this commit the dependency of unmarshallRoute on edge policies being
available is removed. Edge policies may be unknown and reported as nil.
SendToRoute does not need the policies, but it does need pubkeys of the
route hops. In this commit, unmarshallRoute is modified so that it
takes the pubkeys from edgeInfo instead of channelEdgePolicy.

In addition to this, the route structure is simplified. No more connection
to the database at that point. Fees are determined based on incoming and
outgoing amounts.
2018-10-13 22:59:23 +02:00
Conner Fromknecht
2e489fcf24
rpcserver: replace DebugBuild cmp w/ IsDevBuild in AbandonChannel 2018-10-05 13:04:45 +09:00
Conner Fromknecht
0903fe3183
main+lnd: display build.Version() for commit hash 2018-10-05 13:04:45 +09:00
bluetegu
d942bb58c3 Add support for IncludeUnannounced property of ChannelGraphRequest in
DescribeGraph rpc server method.
2018-10-04 14:54:35 -04:00
Olaoluwa Osuntokun
4b1334ad49
rpc: populate additional information in AbandonChannel close summary
In this commit, we extend the AbandonChannel RPC method to store as much
information as possible within the CloseSummary. Most importantly, we
store the current and next (if available) revocation of the remote party
along with the channel config for the local party. With this
information, we have enough data to be able to generate a custom signer
for a new commitment state, or to prove that the channel was indeed
ours if needed.
2018-09-28 16:43:17 -07:00
Wilmer Paulino
bdcc847a44
rpc: remove NewWitnessAddress RPC
In this commit, we remove the unnecessary NewWitnessAddress RPC. We do
this as, at the moment, we only expose the wallet to generate witness
addresses. Now that the RPC has been removed, its REST endpoint has been
assigned to the NewAddress RPC, which should be the de facto way of
having the wallet generate any type of supported address.

Fixes #1986.
2018-09-28 02:52:09 -07:00
Roei Erez
6bc01384d6 udpate code to include the value_sat and value_msat fields in payments 2018-09-27 08:58:18 +03:00
Joost Jager
ab67b9a4de
rpcserver+lnrpc+lncli: add AbandonChannel rpc call
Using AbandonChannel, a channel can be abandoned. This means
removing all state without any on-chain or off-chain action.
A close summary is the only thing that is stored in the db after
abandoning.

A specific close type Abandoned is added. Abandoned channels
can be retrieved via the ClosedChannels RPC.
2018-09-18 12:20:27 -07:00
Oliver Gugger
10b976187d
rpcserver: handle unconfirmed TX properly when listing all transactions 2018-09-15 11:29:32 +02:00
Wilmer Paulino
012d4f5c8c
rpcserver: include new proto fields in ListInvoices rpc 2018-09-12 22:11:59 -07:00
Johan T. Halseth
d742529bb2
rpcserver: set AmtPaidMsat when creating RPC invoice 2018-09-07 14:13:48 +02:00
Roei Erez
f0201fbb32 amount paid should be in satoshies as other fields used for amount 2018-09-05 11:41:48 +03:00
Wilmer Paulino
2906629ae5
rpcserver: implement pagination support for listing invoices
Co-authored-by: Andrey Savitskiy <taketa@users.noreply.github.com>
Co-authored-by: Valentine Wallace <valentine.m.wallace@gmail.com>
2018-08-21 18:00:08 -07:00
Wilmer Paulino
a3cec7e036
rpcserver: set minConfs field in openChanReq 2018-08-16 20:19:29 -07:00
Wilmer Paulino
5c414bb1d0
multi: make OpenChannel take in openChanReq 2018-08-16 20:19:26 -07:00
Wilmer Paulino
29efb02968
rpcserver: enforce fee floor for fee rates input by the user
In a previous commit, we modified our fee rates to be sat/kw internally
as it was possible that the estimated fee rate was not enough to
properly broadcast the transaction. To remedy this, we decided to add a
fee floor, but this would only be enforced when querying the fee
estimator. In this commit, we attempt to do the same thing, but for fee
rates input manually by the user.
2018-08-13 14:39:08 -07:00
Joost Jager
3e7473f4f0 routing: backward searching 2018-08-09 20:23:40 -07:00
Joost Jager
6c918a1806 channeldb: store unknown policies in database
The commit ensures that for every channel, there will always
be two entries in the edges bucket. If the policy from one or
both ends of the channel is unknown, it is marked as such.

This allows efficient lookup of incoming edges. This is
required for backwards payment path finding.
2018-08-09 20:23:40 -07:00
Wilmer Paulino
336f1c156e
rpcserver: convert sat/vbyte fee rates input by the user to sat/kw
In this commit, we explicitly convert sat/vbyte fee rates input by the
user to sat/kw. We do this as users are typically more accustomed to
sat/vbyte fee rates, rather than sat/kw.
2018-08-09 17:29:53 -07:00
Conner Fromknecht
cf2c371042
multi: fix linting errors 2018-08-02 18:20:50 -07:00
Conner Fromknecht
1ded697e8d
multi: sort import paths with gofmt 2018-08-02 18:20:49 -07:00
Olaoluwa Osuntokun
07defe5f93
rpc+peer: use pkScripts for close ntfns 2018-07-31 21:28:52 -07:00
Stefan Menzel
e776a06cfb rpc: disallow a negative invoice amount in AddInvoice 2018-07-25 20:11:46 -07:00
Olaoluwa Osuntokun
e0baa49690
Merge pull request #1387 from wpaulino/send-disable-chan-update
multi: send a channel update with disabled flag set on channel close
2018-07-23 17:46:37 -07:00
Olaoluwa Osuntokun
6f60f139f4 multi: switch over import paths from roasbeef/* to btcsuite/* 2018-07-13 17:05:39 -07:00
Wilmer Paulino
ee10b0a76c
rpcserver: set recently added disabled field to routing policies 2018-07-11 17:07:01 -07:00
Olaoluwa Osuntokun
904342b9e8
rpc: populate response of AddInvoice w/ add index of new invoice 2018-07-06 12:22:02 -07:00
Olaoluwa Osuntokun
892a413be3
rpc: update SubscribeInvoices to send backlog ntfns, also send add ntfns 2018-07-06 12:21:59 -07:00
Olaoluwa Osuntokun
e4c5840472
rpc: ensure new invoice fields are populated in RPC responses 2018-07-06 12:21:58 -07:00
Olaoluwa Osuntokun
b3bb65ea43
rpc: restore proper debug HTLC usage
In this commit, we fix a slight regression that happened when the
sendtoroute RPC call was implemented. As a result of the refactoring,
the debughtlc mode silently broke. In this commit, we fix this by
checking against the zero hash, rather than the length of the payment
hash, as since we use a fixed sized byte slice, it will always be zero.
2018-06-30 17:13:19 -05:00
Olaoluwa Osuntokun
c19c872cff
lnd: update invoiceRegistry to match new switch requirements 2018-06-29 16:03:51 -07:00
Olaoluwa Osuntokun
c914de177b Revert "rpc: include the FinalCltvDelta when writing new invoices to disk"
This reverts commit 4e264ee88e765b9cd15369a02378091c6520a1e6.
2018-06-29 12:40:53 -07:00
Olaoluwa Osuntokun
ff771968b6
Merge pull request #1392 from cfromknecht/signal-package
Signal/Interrupt package
2018-06-28 19:08:51 -07:00
Conner Fromknecht
5144df645b
rpcserver: request shutdown from signal package 2018-06-28 16:17:02 -07:00
Olaoluwa Osuntokun
4e264ee88e
rpc: include the FinalCltvDelta when writing new invoices to disk 2018-06-26 19:50:05 -07:00
Olaoluwa Osuntokun
d82ef41245
rpc: sort closed channels in order of ascending height 2018-06-14 17:14:39 -07:00
Olaoluwa Osuntokun
4a0d7b0244
Merge pull request #1374 from wpaulino/zero-amount-invoice-error
rpcserver: return err when paying 0 amt invoice and amt is not specified
2018-06-13 18:56:04 -07:00
Joost Jager
f80ea51f69 rpcserver: add ClosedChannels call 2018-06-13 08:48:01 +02:00
Wilmer Paulino
63f079d1a4
rpcserver: add fee limit support for routing related RPCs 2018-06-12 18:14:49 -07:00
Sebastian Delgado
6746609ec6
Add constant and percentage-based fee limits to payments
- Extend SendRequest and QueryRoutesRequest protos
- newRoute function takes fee limit and cuts off routes that exceed it
- queryRoutes, payInvoice and sendPayment commands take the feeLimit inputs and pass them down to newRoute
- When no feeLimit is included, don't enforce any feeLimits at all (by setting feeLimit to maxValue)
2018-06-12 18:14:43 -07:00
Wilmer Paulino
f27e0baf7c
rpcserver: return err when paying 0 amt invoice and amt is not specified 2018-06-11 16:33:01 -07:00
Olaoluwa Osuntokun
15f812b10f
lnwire: don't attempt to decode an empty/nil signature 2018-06-08 13:25:56 -07:00
Olaoluwa Osuntokun
bc9eca32ab
rpc: refactor logic for SendPayment+SendToRoute
In this commit, we modify the logic for the two primary payment related
RPCs to reduce duplication, indentation, and consolidate logic. As a
result, we'll now accept rpcPaymentIntents, turn those into regular
paymentIntents (convert from proto) before finally dispatching via
unified function.
2018-06-06 20:45:56 -07:00
t4sk
982f53e6f2 rpc: modify QueryRoutes to take final_cltv_delta 2018-06-06 20:45:01 -07:00
t4sk
6ddd7b4d0d rpcserver: add SendToRoute methods
rpcserver: add SendToRoute handler
2018-06-06 20:45:00 -07:00
Wilmer Paulino
077b1fffcc
Revert "rpcserver: flip inbound bool for display, fix internally later"
This reverts commit 5126e431355ea074404064b91c57732e96d0a1e6 since the
underlying issue has now been fixed.
2018-06-06 16:30:41 -07:00
Olaoluwa Osuntokun
d98d4523e1
Merge pull request #1159 from wpaulino/onion-service-support
multi: add onion services support
2018-06-04 21:46:51 -07:00
Wilmer Paulino
d6d0c26252
rpcserver: add support to connect to onion addresses
In this commit, we now allow connections to onion addresses due to
recently adding support to properly parse them.

Co-Authored-By: Eugene <crypt-iq@users.noreply.github.com>
2018-06-04 20:41:42 -07:00
Olaoluwa Osuntokun
4d37508417
rpc: ensure we don't attempt to create a routing hint with a nil edge
In this commit, we fix an existing panic bug related to the recently
added routing hints feature. If it's the case that the remote node
didn't send us their edge, then when we go to compare the public keys to
see if they match, we may attempt to deref an nil pointer.

In order to fix this, we'll instead check the edgeInfo, which is
guaranteed to also exist if the channel was found in the database. As a
defensive step, before we go to actually aces the struct, we'll check
that's it's non-nil and proceed if it is nil.
2018-06-04 17:21:42 -07:00
Wilmer Paulino
e363766394
multi: increase max funding and payment amount 60x under Litecoin 2018-05-25 00:11:20 -04:00
Johan T. Halseth
5cef2bacde
rpcserver: add TODO for removing coop closes from "pending close" channels 2018-05-24 10:29:20 +02:00
Oliver Gugger
3eff9804ee macaroons: add technical documentation, fix comments 2018-05-18 10:13:25 +02:00
Conner Fromknecht
f963f91a3c
multi: use mutex-guarded ShortChanID() on OpenChannel 2018-05-09 16:06:49 -07:00
Johan T. Halseth
409ab08c36
rpcserver: remove send to settledContracts 2018-05-02 08:43:30 +02:00
Olaoluwa Osuntokun
c54a91f44d
rpc: modify SignMessage+VerifyMessage to bind msg to LN context
In this commit, we modify the SignMessage+VerifyMessage slightly in
order to bind the message we're signing to our specific context. We do
this by pre-pending the ascii text "Lightning Signed Message:" to the
msg before we run it through dsha256. Adding this prefix binds the
message to our context in order to avoid accidentally signing a sighash
or the like.
2018-04-25 19:45:32 -07:00
Johan T. Halseth
97977c8a06
rpcserver: add channels waiting for commitment confirmation to pending channels response 2018-04-25 09:37:25 +02:00
Wilmer Paulino
a34b2d7de2
rpcserver: add missing continue if link wasn't retrieved
In this commit, we avoid hitting a possible panic in the case that we
were unable to retrieve the link of a channel from the HTLC switch while
determining which channels should be used as routing hints for an
invoice.
2018-04-21 11:31:50 -04:00
Wilmer Paulino
4e90691bf3
rpcserver: include routing hints when sending payments 2018-04-20 19:45:01 -04:00
Wilmer Paulino
d1a717ba88
rpcserver: add ability to populate routing hints when creating an invoice 2018-04-20 19:45:00 -04:00
Wilmer Paulino
1b137bf14c
rpcserver: populate the routing hints of an invoice when decoding it 2018-04-20 04:01:36 -04:00
t4sk
49510d775f rpcserver: include millisatoshis in marshallRoute 2018-04-19 09:15:21 +08:00
Olaoluwa Osuntokun
d63b923f5e
Revert "rpcserver: remove uneccessary signal to breacharbiter at force close"
This reverts commit 0f90c950daaec7843e305f32d10e36411fb0b47f.

We actually still need to notify the BRAR of a force close, as
otherwise, it doesn't have a signal to exit due to a local force close
event.
2018-04-17 19:05:40 -07:00
practicalswift
663c396235 multi: fix a-vs-an typos 2018-04-17 19:02:04 -07:00
Olaoluwa Osuntokun
21b6c62bf9
Merge pull request #1020 from mecampbellsoup/add-version-to-getnetworkinfo-rpc
Add version field to GetInfo RPC endpoint
2018-04-17 18:41:18 -07:00
Johan T. Halseth
daeeca0bc3
rpcserver: make copy of htlc rhash before returning in listchannels
This commit fixes a bug where all the HTLC rhash slices in a
ListChannelsResponse would be tied to the loop variable, making them all
take the hash of the last HTLC in the list. This commit fixes it by
making a copy of the slice.
2018-04-15 11:36:20 +02:00
mecampbellsoup
bd398540c1 Add version field to GetInfo RPC endpoint
This is inspired by the Bitcoin RPC `getnetworkinfo` endpoint which also
includes version information:
https://bitcoin.org/en/developer-reference#getnetworkinfo
2018-04-10 09:27:44 -04:00
Olaoluwa Osuntokun
3fa2e08665
test: update testUpdateChannelPolicy to ensure Bob's link uses the proper policies
In this commit, we update the testUpdateChannelPolicy to exercise the
recent set of changes within the switch. If one applies this test to a
fresh branch (without those new changes) it should fail. This is due to
the fact that before, Bob would attempt to apply the constraints of the
incoming link (which we updated) instead of the outgoing link. With the
recent set of changes, the test now properly passes.
2018-04-06 14:52:01 -07:00
Olaoluwa Osuntokun
e30881a14c
Merge pull request #1033 from stevenroose/close-offline
rpcserver: Clarify failure closing offline channel
2018-04-06 12:20:30 -07:00
Steven Roose
445924b7a9 rpcserver: Clarify failure closing offline channel 2018-04-06 10:42:14 +02:00
Vadym Popov
29f1fda60d
rpcserver: include a pending_open_balance in channelbalance response
Changes in `ChannelBalance` rpcserver method implementation to
add `pending_open_balance` counted according state of opened channel
2018-04-01 02:40:50 +03:00
Olaoluwa Osuntokun
6be6b48e09
Merge pull request #840 from halseth/openchannel-csv-delay
Add CSV delay flag to openchannel
2018-03-31 16:05:08 -07:00
Olaoluwa Osuntokun
c5c23eb833
Merge pull request #974 from Roasbeef/invoice-expiry-fix
zpay32+rpc: ensure we can encode an expiry of math.MaxUint64, limit to 1 year in seconds
2018-03-30 13:12:53 -07:00
Olaoluwa Osuntokun
447a031435
peer: reject remote closes with active HTLCs
In this commit, we follow up to the prior commit by ensuring we won't
accept a co-op close request for a chennel with active HTLCs. When
creating a chanCloser for the first time, we'll check the set of HTLC's
and reject a request (by sending a wire error) if the target channel
still as active HTLC's.
2018-03-30 13:06:57 -07:00
Olaoluwa Osuntokun
ecbeca5f29
rpc: disallow attempting a co-op close of a channel with active HTLCs
In this commit, we fix a bug that at times could cause any dangling
HTLC's to be sent to miner's fees if a user attempted to close out a
channel cooperatively that still had pending HTLC's. We'll first prevent
this at the RPC level by rejecting any attempts to trigger a co-op
channel closure while a channel still have dangling HTLC's.
2018-03-30 12:51:01 -07:00
Olaoluwa Osuntokun
ef4512d1d8
rpc: limit the larger invoice expiry to 1 year
This is a follow up to the prior commit. In order to add an additional
layer of defense, we'll reject any expiry greater than 1 year.
2018-03-29 16:25:11 -07:00
Olaoluwa Osuntokun
90a13aedcf
Merge pull request #954 from halseth/remove-breacharbiter-signal
[mini] rpcserver: remove uneccessary signal to breacharbiter at force close
2018-03-28 15:21:42 -07:00
Johan T. Halseth
0f90c950da
rpcserver: remove uneccessary signal to breacharbiter at force close
This signal is no longer needed, as the breacharbiter is given
the UnilateralClosure chain event.
2018-03-28 08:10:19 +02:00
Nalin Bhardwaj
bca87535b3
rpcserver: fix GetInfo testnet detection
Fixes bug with Litecoin testnet detection.
2018-03-24 15:01:12 +05:30
Johan T. Halseth
938aefb573
rpcserver: pass incoming RemoteCsvDelay to server.OpenChannel 2018-03-22 14:54:00 +01:00
Olaoluwa Osuntokun
7d14ed7a06
Merge pull request #904 from Roasbeef/invoice-macaroon
rpc+lnd: add new invoice-only macaroon
2018-03-21 15:27:31 -07:00
Olaoluwa Osuntokun
0155bcfd5c
Merge pull request #881 from Roasbeef/autopilot-target-chan-size
funding+pilot: increase min channel size, allow specifying chan size range for autopilot
2018-03-21 15:11:25 -07:00
Olaoluwa Osuntokun
a07579c541
rpc: modify the entity of invoice related RPC's to target the invoice entity
In this commit, we modify the existing invoice RPC macaroon permissions
to target a more specific entity: “invoices”. As a result of this
commit, once node operators update, they’ll need to regenerate their
readonly.macaroon as it now needs this additional entity encoded within
it.
2018-03-21 15:08:54 -07:00
Olaoluwa Osuntokun
6a294e7489
rpc: extend writePermissions and readPermissions with the invoice entity
In the prior commit, we added a new set of permissions and also a new
entity: “invoices”. We’ll add this set of entities to the read and
write permissions accordingly as well to ensure that the existing
macaroons have access to all the items that the invoice.macaroon does.
2018-03-21 15:08:53 -07:00
Olaoluwa Osuntokun
6c6285344b
rpc: add new invoicePermissions bakery.Op slice for an invoice only macaroon
In this commit, we add a new invoicePermissions slice. This contains
all the permission that a holder of an invoice.macaroon is able to
access, and no others. We also include read and write access to
addresses as this may be useful from the PoV of a merchant or exchange.
2018-03-21 15:08:50 -07:00
Wilmer Paulino
85b03780f3
rpcserver: determine which channels to return based on passed params 2018-03-19 11:19:04 -04:00
Olaoluwa Osuntokun
8127685462
funding+rpc: raise min channel size to 20k satoshis
In this commit, we raise the min channel size to 20k satoshis. This
will be evaluated before we check for dusty commitments. The goal of
this is to ensure ample room for fees at current, and future fee
levels.
2018-03-18 17:10:25 -07:00
Conner Fromknecht
bb16f9d29a
rpcserver: use primary chain default CLTV for add invoice 2018-03-14 16:57:43 -07:00
Olaoluwa Osuntokun
800eea931f
build+multi: switch from bolt to bbolt
In this commit, we switch from boltbd/bolt to coreos/bbolt as the
former is no longer being actively maintained.
2018-03-10 19:01:13 -08:00
Conner Fromknecht
935c757102
rpcserver: allow unsafe-disconects 2018-03-09 21:18:15 -08:00
Olaoluwa Osuntokun
b41222b316
rpc: update RPC server to disallow p2pkh adds, assume segwit for ConfirmedBalance 2018-03-06 16:04:04 -05:00
Olaoluwa Osuntokun
02852cdc3b
rpc: implement new ForwardingHistory command 2018-03-06 13:56:12 -05:00
Olaoluwa Osuntokun
06c1030999
rpc: populate new day, week, and month fee sums in FeeReport 2018-03-06 13:56:12 -05:00
vegardengen
a1fb22eb8d rpc: properly populate fee field in listpayments 2018-03-06 13:21:03 -05:00
Olaoluwa Osuntokun
f7ec490f44
Merge pull request #762 from halseth/fee-estimator
Add types for representing fee rates
2018-02-26 17:22:50 -08:00
Olaoluwa Osuntokun
7f04d927a0
rpc: fix queryroutes bug that assumed precise number of returned routes
In this commit, we fix a bug in the query routes RPC that could at
times lead to a panic. This would happen if the number of returned
routes was less than the number of expected routes. To remedy this,
we’ll return the minimum of the number of requested routes, and the
number of routes actually returned.
2018-02-26 16:31:50 -08:00
Johan T. Halseth
ba3f3e1942
rpcserver: express fee rates using types 2018-02-26 22:42:27 +01:00
Johan T. Halseth
31ec79e7ae
Merge branch 'master' into master 2018-02-21 13:54:26 +01:00
Jason Dufair
84551c616f lnwallet/lnrpc: Expose sync status to gRPC interface
This commit adds wallet_best_block_timestamp to the gRPC interface.
This is done in order to allow clients to calculate progress while
lnd syncs to the blockchain. wallet_best_block_timestamp is exposed
via the GetInfo() rpc call. Additionally, IsSynced() returns the
WalletBestBlockTimestamp as the second value in the tuple
that is returned, providing additional detail when querying about the
status of the sync. The BtcWallet interface has also been updated
accordingly.

This commit was created to support the issue to
[Add progress bar for chain sync] (lightninglabs/lightning-app#10) in
lightning-app
2018-02-20 19:00:06 -08:00
MeshCollider
2c2ed3c6a9 multi: Unify use of NodeKey in log messages 2018-02-19 17:48:39 -08:00
MeshCollider
4c42079436 multi: ensure NodeKey is set in rpc/cli 2018-02-19 17:48:39 -08:00
MeshCollider
915c4201b9 multi: remove internal peer_id usage 2018-02-19 17:48:39 -08:00
Daniel McNally
56c01ebcfe rpcserver: passing active net to zpay32.Decode 2018-02-19 10:20:54 -05:00
Olaoluwa Osuntokun
1879130f64
rpc: modify QueryRoutes response to return exact number of requested routes 2018-02-12 16:29:12 -08:00
Olaoluwa Osuntokun
65d6d77ef4
rpc: fix macaroon path entity for OpenChannelSync
In this commit, we fix a typo that caused issues when trying to use the
OpneChannelSync call.

Fixes #748.
2018-02-11 17:15:46 -08:00
Olaoluwa Osuntokun
22951cb364
lnd: account for new lnwire.Sig API and channeldb API changes 2018-02-06 20:14:33 -08:00
Daniel McNally
8543497dcc multi: fixing it's/its typos in comments 2018-02-06 19:13:07 -08:00
practicalswift
a93736d21e multi: comprehensive typo fixes across all packages 2018-02-06 19:11:11 -08:00
MeshCollider
4affab7bd7 multi: Addressing Tor support review comments 2018-02-05 17:37:46 -08:00
nsa
8c482f2be7 multi: Added a NetInterface to clean up config.go
This commit adds a new interface named NetInterface and two
implementations of it: RegularNet & TorProxyNet. These two structs
are used in config.go in an attempt to clean up the code and
abstract away the dialer and DNS functions.
2018-02-05 17:37:46 -08:00
nsa
e2142c778f multi: Added Tor support
This commit adds Tor support. Users can set the --TorSocks flag
to specify which port Tor's SOCKS5 proxy is listening on so that
lnd can connect to it. When this flag is set, ALL traffic gets
routed over Tor including DNS traffic. Special functions for
DNS lookups were added, and since Tor doesn't natively support
SRV requests, the proxySRV function routes connects us to
a DNS server via Tor and SRV requests can be issued directly
to the DNS server.

Co-authored-by: MeshCollider <dobsonsa68@gmail.com>
2018-02-05 17:37:46 -08:00
Olaoluwa Osuntokun
0d09f7a32a
Merge pull request #627 from cfromknecht/invert-inboud-display
rpcserver: flip inbound bool for display, fix internally later
2018-02-05 16:22:13 -08:00
Olaoluwa Osuntokun
7144707734
rpc: store display of alias in getinfo 2018-02-01 11:55:02 -08:00
Alex
21c29c33d7 multi: upgrade macaroons to v2, replace per-method auth with interceptors
This commit reworks the macaroon authentication framework to use the
v2 macaroon format and bakery API. It also replaces the code in each
RPC method which calls the macaroon verifier with interceptors which
call the macaroon verifier instead. In addition, the operation
permissions are reworked to fit the new format of "allow" commands
(specifically, entity/operation permissions instead of method
permissions).
2018-01-31 17:14:49 -08:00
Wilmer Paulino
f674e10a2b
lnd+cmd/lncli: handle ChannelPoint funding txid proto update
Since a ChannelPoint's funding txid can now be get/set as raw bytes or
a string, we first need to check what type it's currently set to before
accessing it.
2018-01-27 22:00:01 -05:00
Andrew Naoum
0f161c5033 channeldb+lnrpc: store the payment pre-image not rhash
Fixes #481.

Prior to this commit, payments stored in the channel DB only kept a
record of the payment hash. This is a problem as the preimage is what
serves as proof of payment and a user should be able to look up this
value in the future (not just immediately after payment).

Instead of storing both the payment hash and the preimage, we store the
preimage only since the hash can be derrived from this using a SHA256.

In the RPC listpayments command, we now give the preimage in addition to
the payment hash.
2018-01-27 18:36:33 -08:00
Wilmer Paulino
af16654c0c
rpcserver: allow payment of invoices with zero amount 2018-01-27 19:05:24 -05:00
Wilmer Paulino
1570c0ece8
rpcserver: allow creation of invoices with zero amount 2018-01-27 19:05:22 -05:00
Olaoluwa Osuntokun
4f91b66c51
Merge pull request #467 from bcongdon/feature/customize-alias-and-color
cmd/lncli+lnd: Add alias and color customization
2018-01-24 16:48:36 -08:00
Olaoluwa Osuntokun
d4e650c85d
peer: the chancloser no longer needs to notify the breach arb of settled transactions 2018-01-22 19:19:59 -08:00
Olaoluwa Osuntokun
69e6ec9954
peer+funding: remove unneeded channel handoff code with the breach arbiter
We no longer need to hand off new channels that come online as the
chainWatcher will be persistent, and always have an active signal for
the entire lifetime of the channel.
2018-01-22 19:19:50 -08:00
Olaoluwa Osuntokun
bfbec1c5d3
rpc: properly pass through the FinalCltvDelta param from the proto 2018-01-22 19:19:42 -08:00
Olaoluwa Osuntokun
3c66d94f87
rpc: route all channel force close requests through the ChainArbitrator 2018-01-22 19:19:38 -08:00
Conner Fromknecht
5126e43135
rpcserver: flip inbound bool for display, fix internally later 2018-01-18 14:10:35 -08:00
Benjamin Congdon
f1f1c8a257
rpc: Remove SetAlias and add Alias to GetInfo Response
This commit removes the SetAlias RPC function because it was deemed
unnecessary. This commit also populates the Alias field in the GetInfo
response
2018-01-18 07:39:37 -06:00
Johan T. Halseth
1f6268cdde
rpcserver: use cfg.Bitcoin.TimeLockDelta as default CLTVExpiry for invoices 2018-01-12 22:56:41 +01:00
Johan T. Halseth
f3dff2ae97
rpcserver: add min_htlc_msat parameter to OpenChannel and OpenChannelSync 2018-01-12 22:56:38 +01:00
Johan T. Halseth
c4139b9f89
rpcserver: rename UpdateFees -> UpdateChannelPolicy
This commit changes the name of the UpdateFee method to
UpdateChannelPolicy, to mimic the recent proto change.
It also reads and validates the passed TimeLockDelta,
and sends it to the gossiper for announcing it to the
network, and to the switch for updating the forwarding
policy of the links.
2018-01-12 22:56:34 +01:00
Olaoluwa Osuntokun
6f408004e2
lnrpc+rpc: remove SetAlias method
In this commit we remove the SetAlias method as it’s being removed in
favor of instead using a static configuration parameter.
2018-01-10 15:16:46 -08:00
Olaoluwa Osuntokun
fa6354b223
lnrpc: remove blocks_till_open field from PendingChannelsResponse
In this commit, we remove the blocks_till_open from
PendingChannelsResponse as in its current state, the values that are
assigned to this field don’t accurately reflect the naming. This has
caused a good bit of confusion amongst users lately. As a result, we’re
temporarily removing this field until we have proper incremental
notifications within the chain notifier.
2018-01-08 19:50:17 -08:00
Wilmer Paulino
f4a649b30a
rpcserver: add uris to getinfo response 2018-01-07 13:26:18 -05:00
Olaoluwa Osuntokun
7421584341
lnrpc: making PendingChannels req/resp naming scheme consistent
In this commit we rename the lnrpc.PendingChannelRequest and
lnrpc.PendingChannelResponse to
lnrpc.PendingChannelsRequest/lnrpc.PendingChannelsResponse. We do this
as we strive to ensure that the naming scheme across the RPC interface
is consistent.
2018-01-04 14:20:31 -06:00
Thijs Triemstra
607b394f38 fix typos in rpcserver 2018-01-03 19:23:26 +01:00
nsa
3beef359a2 rpcserver: forward private parameter to OpenChannel 2017-12-17 18:35:34 -08:00
Olaoluwa Osuntokun
8411a5b8ce
rpc: on chan close, fallback to default fee rate if fee estimate too low
On testate as times the fee estimation can swing widely. As we
currently don’t yet use vsize everywhere internally, we’re forced to
manually scale to weight for the moment. If the returned fee rate is
too low, then it can cause our estimate to go to zero. This also has
the effect of meaning that the chanCloser doesn’t currently advance if
the initial starting fee is zero.
2017-12-16 16:37:41 -08:00
Olaoluwa Osuntokun
4f2a8fd533
rpc: expand external fee to properly tally HTLC outputs 2017-12-11 15:31:18 -08:00
Olaoluwa Osuntokun
60791d83d5
rpc: detect dangling satoshi amounts, display as CommitFee in ListChannels
In this commit we fix a cosmetic bug within our RPC output for list
channels. We have a policy of always showing SAT instead of mSAT
externally. This led to user confusion, as if Alice or Bob ended up
with a fractional amount of satoshis, then the sum of trimmed amount
would be silently sent to miner’s fees. An example being: Alice ending
up with `8998999 mSAT` (`8998.999 SAT`). Bob similarly ends up with
`1001001 mSAT` (`1001.001 SAT`). `8998.999 + 1001.001  = 10000.0 SAT`.
However, we can't express that fractional amount (totaling `1 SAT`
across both commitment transactions) so it goes to miner fees.

To remedy this on the RPC interface level, we’ll now detect if we have
a dangling satoshi, and properly list it as going towards the miner fee
on the commitment transaction.

Fixes #468.
2017-12-10 17:10:09 -08:00