Commit Graph

230 Commits

Author SHA1 Message Date
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
Olaoluwa Osuntokun
8a351a7388
rpc: fix typo marshalRoute -> marshallRoute 2017-12-10 17:02:51 -08:00
Micah Lerner
0f3ff119e8 rpcserver: add SettleDate to rpcserver invoice response 2017-12-08 16:50:04 -08:00
Micah Lerner
6ae7d275ab lnwallet: Add destination addresses to listchaintxns 2017-12-08 15:11:23 -08:00
Olaoluwa Osuntokun
9a32bee171
rpc: a link is now only active if it is eligible to forward HTLCs
In this commit, we further constrain the candidacy for an “active”
channel. In addition to being present within the link, it *must* also
have the RemoteNextRevocation set. Otherwise, this indicates that we
haven’t yet processed a FundingLocked message for this channel.
2017-12-06 16:42:58 -08:00
Olaoluwa Osuntokun
bd11529ae9
rpc: populate local CSV delay in ListChannels 2017-12-05 17:46:19 -08:00
Nalin Bhardwaj
a234e01c07
lnrpc+proto: Modify WalletBalance to include detailed balance info 2017-12-04 05:34:39 +05:30
Olaoluwa Osuntokun
ad71a62b96
rpc: compute and display blocks left till channel open in PendingChannels 2017-12-02 18:41:51 -08:00
Olaoluwa Osuntokun
a034febde0
rpc: display node color in RPC output for LightningNode 2017-12-02 18:37:42 -08:00
Olaoluwa Osuntokun
7bd2cd0a16
rpc: only cancel closeObserver if force close succeeds 2017-12-01 19:11:42 -08:00
Olaoluwa Osuntokun
ad364ae9a1
chains+server: if not in simnet mode, use BtcdFeeEstimator 2017-11-23 23:10:12 -06:00
Olaoluwa Osuntokun
afaa1681c8
rpc: OpenChannel, CloseChannel, SendMany/SendCoins now respect fee args
In this commit, the relevant RPC’s have been modified to properly
parse, and pass through the new fee control related parameters for each
of the RPC’s.
2017-11-23 23:10:09 -06:00
Johan T. Halseth
6065c763e6
rpcserver: only set channel Active=true if added to htlcswitch
For a calls to ListChannels we now only set the
ActiveChannel.Active=true if the link is found by the
htlcswitch. This is done to be able to make it possible
to tell if a newly opened channel has been added to
the htlcswitch, such that we can synchronize on this
during tests before we attempt to close the  channel.
2017-11-20 14:22:14 -08:00
Olaoluwa Osuntokun
caec23a236
Merge pull request #384 from cfromknecht/utxn-incubate-2nd-layer-htlcs
Utxo Nursery, adds outgoing 2nd-layer HTLC persistence
2017-11-16 19:00:40 -08:00
Conner Fromknecht
5a2769664a
rpcserver: populate pending channel resp with htlcs 2017-11-16 16:16:05 -08:00
Conner Fromknecht
eee4c225bf
rpcserver: check for errors returned from incubation 2017-11-16 16:16:04 -08:00
Olaoluwa Osuntokun
d2c8f01768
routing/chainview: remove possibility of deadlock in shutdown of blockEventQueue 2017-11-16 16:01:21 -08:00
Olaoluwa Osuntokun
1be2a2a56a
rpc: display HTLC amount in satoshis in ListChannels response
Before this commit, they were displayed in mSAT which violates the
current trend of always displaying amounts externally in satoshis.
2017-11-15 18:23:58 -08:00
Conner Fromknecht
23343c0700
rpcserver: adds signed blocks til maturity in pending channels 2017-11-15 18:04:44 -08:00
Jim Posen
c501da3a95 lnd: Context timeouts on SendPayment RPC request in tests.
This helps catch issues in the RPC tests faster by putting a timeout
on all SendPayment requests. Otherwise, if a payment stalled, the test
would run until the test suite timeout, 10 minutes. Also simplifies
some code with a helper function and using SendPaymentSync where
possible.
2017-11-13 20:52:07 -08:00
Olaoluwa Osuntokun
b6f64932c2
htlcswitch: face race condition in unit tests by returning invoice
In this commit we modify the primary InvoiceRegistry interface within
the package to instead return a direct value for LookupInvoice rather
than a pointer. This fixes an existing race condition wherein a caller
could modify or read the value of the returned invoice.
2017-11-11 16:09:29 -08:00
Olaoluwa Osuntokun
8a69397714
rpcserver: update calls to adhere to new channeldb API's 2017-11-10 19:51:10 -08:00
Olaoluwa Osuntokun
e337a329cd
peer+rpc: properly set ChainHash in ChannelCloseSummary instances 2017-11-10 19:51:09 -08:00
Olaoluwa Osuntokun
a29210f089
rpc: properly interpret and parse cltvDelta from payreqs (if exists) 2017-10-22 18:37:00 -07:00
Olaoluwa Osuntokun
bdc4d09b25
rpc: display the cltv expiry in decoded pay req 2017-10-22 18:36:55 -07:00