Commit Graph

219 Commits

Author SHA1 Message Date
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
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
Olaoluwa Osuntokun
22881ec05e
rpc: in createRPCInvoice properly populate CltvExpiry 2017-10-22 18:36:55 -07:00
Olaoluwa Osuntokun
5bc906dd18
rpc: properly parse our CltvExpiry in AddInvoice 2017-10-22 18:36:54 -07:00
Johan T. Halseth
15d753fd9e
rpcserver: use BOLT-11 compatible zpay32 package.
This commit changes the rpcserver to rely on the new zpay32
package, and support the new payment request options available
in the BOLT-11 invoice format.
2017-09-27 13:17:28 +02:00
Olaoluwa Osuntokun
d76f660eb1
rpc: in logging for CloseChannel RPC, also log the force parameter 2017-09-12 18:00:46 +02:00
Olaoluwa Osuntokun
2b2a3714c1
multi: fix linter errors 2017-08-22 01:00:12 -07:00
Olaoluwa Osuntokun
3df5b090da
rpc: enforce the max payment size as defined in BOLT-0002
This commit modifies the relevant RPC’s to enforce the max payment size
as defined in BOLT-0002. With this commit the largest payment possible
is now 2^32 mSAT, or 4,294,967 satoshis.
2017-08-22 00:53:57 -07:00
Olaoluwa Osuntokun
1a90991905
rpc: ensure the inner grouting within SendPayment will always exit
This commit adds a new reqQuit channel within SendPayment. The inner
goroutine will use this channel to detect if the request itself has
exited or not. Without this method, we’d possible leak a goroutine if a
client never closed the payment stream.
2017-08-22 00:53:54 -07:00
Olaoluwa Osuntokun
6ad803b99c
rpc: make NewWitnessAddress return np2wkh addresses
This commit modifies NewWitnessAddress to return nested p2wkh address.
We do this as this RPC call was put in place to be used within GUI’s to
allow users to deposit funds into their LN wallet. By using nested
p2wkh, we ensure that the generate address that can be used to directly
create channels.
2017-08-22 00:53:51 -07:00
Olaoluwa Osuntokun
d49172aa50
rpc: add feereport to set of read only macaroon caveats 2017-08-22 00:53:48 -07:00
Olaoluwa Osuntokun
44cafb01ae
rpc: add implementations for UpdateFees and FeeReport 2017-08-22 00:53:46 -07:00
Olaoluwa Osuntokun
01b0ddf1c5
lnd+rpc: update RPC responses to convert mSAT to SAT 2017-08-22 00:52:56 -07:00