1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-02-24 22:58:23 +01:00
Commit graph

1422 commits

Author SHA1 Message Date
Andrea
6884725934
Rework getInfo parameter passing, update the mock for it 2019-03-15 17:09:11 +01:00
Andrea
e8069d5719
Fix usage of the deprecation config key (use-old-api) 2019-03-15 17:05:53 +01:00
Andrea
8268e70c35
Rename config key and make new API enabled by default 2019-03-15 14:25:27 +01:00
Andrea
1fe65f4231
Move out /help from EclairApi 2019-03-15 14:23:14 +01:00
Andrea
7b6c020fe1
Add ByteVector32 Serializer to JsonSupport scope 2019-03-15 14:17:45 +01:00
Andrea
72cf2e87b5
Re-enable output processing with JQ in eclair-cli 2019-03-15 14:04:21 +01:00
Andrea
8c3d7d843a
Fix ClassCastException when mapping the channels responses to ByteVector instead of ByteVector32 2019-03-15 13:56:07 +01:00
Andrea
53ec015e02
Separate Service and EclairApiImpl 2019-03-15 12:27:33 +01:00
Andrea
ec10feb40a
Do not return Route(s) from the implementation of API methods, add test for /connect 2019-03-15 11:29:55 +01:00
Andrea
5ff5042f2d
Add mock file for /help 2019-03-14 18:35:05 +01:00
Andrea
b52ba9c05e
Merge remote-tracking branch 'origin/use-bitcoin-0.17.1' into api_revamp 2019-03-14 18:34:37 +01:00
Andrea
837ac03dd9
Accept shortChannelId in /close, finish porting the test from the previous APIs 2019-03-14 18:34:18 +01:00
Andrea
305219d929
Finish merging master 2019-03-14 16:19:19 +01:00
sstone
31ce0c688e
Fix transactions unit test
To reconstruct the tx commit number we need to take the lower 24 bits of the locktime field.
2019-03-14 16:04:29 +01:00
Fabrice Drouin
f662a6a787
Merge branch 'master' into use-bitcoin-0.17.1 2019-03-14 15:18:54 +01:00
Andrea
d08ebb67b7
Rebase with master 2019-03-14 15:05:13 +01:00
Andrea
3b2df4b6e2
Merge remote-tracking branch 'origin/master' into api_revamp 2019-03-14 15:01:16 +01:00
Pierre-Marie Padiou
b681cfca47
Replace BinaryData by scodec.bits.ByteVector (#896)
See https://github.com/ACINQ/bitcoin-lib/pull/31.

We still have to use `Array[Byte]` for low-level cryptographic primitives, and `akka.util.ByteBuffer` for tcp connections. In order to reduce unnecessary copies, we used `ByteVector.view(...)` as much as possible.

Took the opportunity to do a project-wide optimize imports. We might as well do it now since pretty much all files have been touched already.

NB: temporarily use bitcoin-lib 0.10.1-SNAPSHOT because maven central is very slow and we can't access the recently release 0.10 for now.
2019-03-14 12:43:28 +01:00
araspitzu
889e86a908
Move the param 'randomize' from RouteRequest to RouteParams (#895)
* Move the param 'randomize' from RouteRequest to RouteParams
2019-03-13 18:58:55 +01:00
Andrea
c9e573a4c2
Improve error handling via rejections 2019-03-13 18:50:50 +01:00
Andrea
cecb6bcdd8
Fix help command in eclair-cli 2019-03-13 18:18:42 +01:00
Andrea
1eedeb054a
[WIP] eclair-cli 2019-03-13 16:32:19 +01:00
Andrea
8ba0e0a3a8
Adjust eclair-cli for the new APIs, output the invoice for /receive endpoint 2019-03-13 15:53:17 +01:00
Andrea
3b20d1e490
[WIP] Update eclair-cli 2019-03-13 15:28:50 +01:00
Andrea
746a5daf9a
Remove Json4s generic unmarshaller from scope 2019-03-13 15:17:29 +01:00
Andrea
af9a9691bc
[WIP] fix eclair-cli to use the new APIs 2019-03-13 13:13:01 +01:00
Andrea
7908f5e58d
Use custom http headers in all API response 2019-03-13 10:32:17 +01:00
Andrea
066634f3a2
Use HTTP POST and formParams 2019-03-13 10:16:42 +01:00
Andrea
36da70e1dc
Add configuration to enable the new APIs 2019-03-12 18:11:31 +01:00
Andrea
514cc356b7
[WIP] port to new service reorg the exception handler to make it work for real! 2019-03-12 18:03:26 +01:00
Andrea
528f195c45
[WIP] port to new service the http-basic auth 2019-03-12 17:50:58 +01:00
Andrea
1e8c2339e2
[WIP] port to new service the websocket 2019-03-12 17:44:15 +01:00
Andrea
8aebef538e
[WIP] port to new service checkpayment/audit/networkfees/channelStats 2019-03-12 17:09:07 +01:00
Andrea
848563b87a
[WIP] port to new service receive/parseinvoice/findroute/send 2019-03-12 16:11:30 +01:00
Andrea
dd909bf5c7
[WIP] port to new service allupdates calls 2019-03-12 15:00:29 +01:00
Andrea
2635e1dd0a
[WIP] port to new service more 'calls' 2019-03-12 14:36:42 +01:00
Pierre-Marie Padiou
2712e30504
Better error logs for socks5 proxy (#893) 2019-03-12 13:37:27 +01:00
Fabrice Drouin
abba9f77ec NetworkDb: remove stale channels in batch (#886)
Add methods to delete channels and tags channels as pruned in batch which is much
more efficient in sqlite.

* Network db: minor changes in unit tests

Test pruning a few 1000s channels at once.

* NetworkDb API: use Iterators and not Seq

It's more consistent with our code base.
2019-03-12 13:34:40 +01:00
Andrea
134ceeb65b
Remove swakka 2019-03-11 18:52:29 +01:00
Andrea
6bad025be3
[WIP] wire new service to api socket 2019-03-11 18:29:14 +01:00
Andrea
e148fce242
[WIP] Migrate to new API service 2019-03-11 17:32:25 +01:00
sstone
a752d65c19
BitcoinCoreWalletSpec: fix formatting issue 2019-03-06 21:25:40 +01:00
sstone
e52e385a46 Merge branch 'master' into use-bitcoin-0.17.1 2019-03-06 16:38:41 +01:00
Pierre-Marie Padiou
70397962b6
Clean channels with unexisting funding tx (#714)
There are several separate but related changes in this PR:

(a) Fast close on scenarii where we have nothing at stake (instead of going to `CLOSING` state). The previous process was not only slower (we had to wait for confirmations), but it never resolved when the funding tx hadn't been confirmed. Note that there is still an edge case where the funding tx never gets confirmed, we are fundee and we have something at stake (`push_msat` > 0).

(b) When *fundee*: after a timeout (5 days), if the funding tx hasn't reached `min_depth`, we cancel the channel.

(c) When *funder*: there is no timeout on the funding tx: however on restart, if we detect that our funding tx was doublespent, then we cancel the channel. Just because there is a doublespend doesn't mean that something malicious is going on: e.g. fee was to low, the tx was eventually removed from mempools and we just spent the inputs on something else).

Commits:

* set proper channelid in logs on restore

* fast close if we have nothing at stake

* added fundingTx and timestamp to DATA_WAIT_FOR_FUNDING_CONFIRMED

Also added migration codecs and tests

* implemented funding timeout for fundee

After a given delay, fundee will consider that the funding tx will never
confirm and cancels the channel.

Note that this doesn't apply to the funder, because our implementation
guarantees that we have sent out a funding tx, and the only way to be
sure that it will never be confirmed is that we double spend it. We just
can't rely on a timeout if we want to be safe.

* Electrum: detect if a wallet transaction has been double-spent

If it's in the mempool, or if it's been confirmed, then it's not double spent.
If it's not confirmed and not the mempool, we check if we have a transaction in
our wallet that sspends one of the inputs of our tx. If we find one, then it's been
double spent.
This will work with our funding txs, but not with their funding txs.

* fix regression with dataloss protection

The fast close causes a regression with dataloss protection, because
if we have nothing at stake we won't publish anything in case of
error (even if our peer asks us to).

This fixes #854.
2019-03-06 11:10:40 +01:00
sstone
3151360595 BitcoinCoreWallet: add signing tests with multiple bad inputs
Check that we handle errors properly when signrawtransactionwithwallet returns multiple errors.
2019-03-06 10:17:41 +01:00
sstone
de83752feb
Check that bitcoind version is 0.17.0 or higher
Plus minor code reformatting for some tests.
2019-03-03 20:35:11 +01:00
sstone
e9fb058345
Bitcoin Wallet: cleaner handling of signtransaction errors 2019-03-02 15:19:42 +01:00
sstone
fabd4d074a
Merge branch 'master' into use-bitcoin-0.17.1 2019-03-02 12:59:47 +01:00
Pierre-Marie Padiou
f9ead30b5c
Set default to-remote-delay-blocks to 720 (#879)
It sounds like a more reasonable default value, 144 was too short.

Keep using 144 blocks for our integration tests.
2019-02-25 18:00:17 +01:00
sstone
3f8f328f70 Remove unused travis files
We download bitcoin core and check with maven now.
2019-02-25 09:38:10 +01:00