* always print `shortChannelId` in hex
* fixed logs in `ThrottleForwarder`
* logs the `paymentHash` when relaying an htlc
* don't print all channel data when restoring a channel
* added logs to relayer
* reduced log level in Peer
* cleaned up switchboard logs
* fixed `id`/`channelId` mixup in relayer logs
* slight changes in log levels
* do not log as warning when tx generation is simply skipped
* streamlined relayer logs
* improved router logs
* don't display errors when witness can't be parsed
* don't log connection errors as warnings
* reduce amount of logs in case of local known error
* removed reconnection message to deadletter
* try a cleaner way of displaying channel errors
* put some reconnection-related logs from info to debug
* peer: ignore `Rebroadcast` messages in `INITIALIZING`
* less verbose exception logging in channel
* display friendlier close type
* reduced default log level to INFO
Fixes#318, #317, #306
* README should recommend TESTNET
* (gui) ui can parse lightning: and lightning:// schemes
* (gui) Relaxed decimal amount regex: accepts no leading int
* (gui) Added a node info modal displaying node URI as QR code
* (gui) Logging throwable when gui can not start
* reworked peer management
- connection and channel opening are now separated, simplified
`switchboard`
- use a single authenticator for both incoming and outgoing connections
- `peers` api call now returns current state and channel count
* fixed last commit
* fixed last merge
* added inetsocketaddress serializer
* forget about channels older than 3 days and prune every minute
* Revert "forget about channels older than 3 days and prune every minute"
This reverts commit 347e01b5c18208f162b31663d383d5b7de36eea7.
* added pruning pre-validation
* don't pre-prune channels that don't have channel_update, but don't validate them either
* removed println
* removed useless handler
* cleanup announcement db at startup
* simplified pruning logic and re-enabled tests
* fix `getStaleChannels`
* fixed integration tests
* Electrum: Add unix timestamp to WalletReady notification
* Electrum: don't send WalletReady when we get disconnected
* Electrum: check that WalletReady notification is sent on reconnection
* Electrum: don't same the same ready notification more than once
We don't use state transitions to send notifications anymore
* Electrum client: use tcp keep-alive
* factorized socket options
Service pattern matching code visually separates each method and
params to improve the code readability and maintenance. Route completion
is handle on a case by case basis, for each call. This enables better error
management and useful feedback to the caller.
Added custom rejections to handle cases where the given rpc method or
params are not found or not correct.
HTTP code should now be consistent with the error returned.
* Core fee estimator: return result in satoshi per byte
It was still in satoshi per kb
* Electrum: use actual tx weight to estimate fees when funding a tx
This fixes#303
* Received payments are stored in a DB; added api calls for basic select
When the local payment handler receives a valid htlc, a Payment { payment_hash,
amount_msat, timestamp } is added in a sqlite DB. This enables the node
operator to check if a payment has been received.
Two methods are added to the JSON RPC API: list the payments and find a payment
by its payment hash.
* Test LocalPaymentHandler checking that received payment is saved in DB
* Payment API call accepts only valid paymentHash and paymentRequest arg
* API should expose only a `checkpayment` method
Interaction with payment DB from API goes through the payment handler
Also removed exception/rejection handlers to stay consistent with the api
* Updated README with checkpayment API method; moved Payment to PaymentDB
The previous assumption that a `channel_update` only exists when we have a
related `channel_announcement` does not always hold true. There are two
special cases:
- we want the `router` to know of our outgoing `channel_update` as soon as
a channel reaches `NORMAL` state, so that we can immediately send
payments
- we need to know remote's `channel_update` even for private (unannounced)
channels, in order to be able to receive funds (we will put those as
hints in the payment request using the `r` field); we also need to send
out our `channel_update` for private channels for the same reason
In order to do that, two fields were added to the `router`'s state:
- `privateChannels`: similar to `channels`, but holds a fake `channel_announcement`s for local channels that are private or are public but not yet announced
- `privateUpdates`: similar to `updates`, but holds `channel_update`s related to local channels that are private, or are public but not yet announced.
For local public channels, we will have `channel_update` both in `updates` and in `privateUpdates`, but the latter has the precedence when computing routes.
Also, in the `channel` we now handle the sending of new `channel_update` during the transitions, as opposed to in the state handlers.
Note that this changes the serialization format, making this upgrade not backward-compatible.
This fixes#244.
In commit 2e2a47e5fd we inverted the
`local`/`remote` `toSelfDelay` when building the commitment tx, but forgot
to do the same when claiming the outputs.
Updated integration tests to reproduce the issue.
This fixes#290.
The `relayer` was missing failures sent by the `channel`, which led to `htlc` lingering without being failed. Sender would see payments stuck in `PENDING` state until they eventually timeout and cause the channel to be unilaterally closed.
This is a regression caused by f47ea72369.
This fixes#264.
The `relayer` wasn't correctly handling failures from the `register`, which led to `htlc` lingering without being failed. Sender would see payments stuck in `PENDING` state until they eventually timeout and cause the channel to be unilaterally closed.
This is a regression caused by f47ea72369.
* (gui) Default unit should be milliBTC
* Default unit set to MILLI_BTC
* Added tests to String amount conversion function
* Added BTC unit
* Removed milliSatoshi unit when opening a channel
* Removed redundant dependency and added a unit test
This is a regression caused by 0794fb8d5a,
because default values provided for `git.commit.id` `git.commit.id.abbrev`
are not overriden by git-commit-id-plugin plugin.
Instead we specify these variables when doing the docker build.
* include raw tx when sig check fails
See BOLT 1 recommendation:
"when failure was caused by an invalid signature check:
SHOULD include the raw, hex-encoded transaction in reply to a
funding_created, funding_signed, closing_signed, or commitment_signed
message."
Also, removed redundant signature check in state
`WAIT_FOR_FUNDING_SIGNED`.
* enforce closing fee <= commitment fee
In accordance to BOLT 2.
Note that it is safe to consider feerates instead of fees, because
weight(closingTx) < weight(commitTx).
This fixes#243.
* use channel logger in Helpers.scala and Commitment.scala
* handle multiple closing txes
Nothing prevents the counterparty to publish any or several of the closing txes
before the negotiation is finished, we need to handle this case.
This fixes#245.
* added msg+state when chanel failure occurs
* proper handling of invalid closing sig
* removed hardcoded error messages in channel
* return an `error` to sync attemps when in CLOSING
* peer now return an error for unknown channels
* added fee negotiation details in logs
* properly display errors, reject closing fee to high
* return `UnknownNextPeer` when next channel is unknown
* correctly relay channels errors (fixes#227)
* keeping `channel_update` in DATA_NORMAL
* moved class `ForwardLocalFail`->`AddHtlcFailed`
* made `AddHtlcFailed` a `ChannelException`
* unannounced channels now return `channel_update` in errors
* use remote `htlc_minimum_msat` in `channel_update`
also set default `htlc-minimum-msat`=`10000`
This fixes#248.
* Announce short channel id when funding depth ok
* added logs to router
* channel do not send `node_announcement` anymore
Dependency to `git` has been removed, we now use `notag` when building without
a git directory.
In order to reliably fetch all dependencies, we do a first blank build
(with no source files), then we copy the sources and do a real commit.
This is a simpler and more robust approach.
Also, fixed the .dockerignore to filter out IDE files.
* disable dust limit checks on regtest and testnet
* fundee should also check dust limit they received open_channel (see #236)
* channel state tests: accept optional node parameters
use defaults if not provided
* Enable generation of a payment request without amount
The amount field in a `PaymentRequest` was already optional but eclair
did not permit the generation of such a request.
Added a new `receive` service with no required amount field.
In the GUI, the parsing of the amount field and its conversion to
`MilliSatoshi` are reworked to better handle decimals.
* (gui) Amount's can be overriden when sending a payment request
The amount of a payment request can be changed and it is up to the
receiving node to accept or deny the payment according to its
implementation.
This also enables the user to pay through the GUI a payment request
where the amount has not been set, such as a donation. The amount is still
required!
The description field has also been added in the GUI. It is empty if the
description has not been set.
* (gui) Properly parse amounts from open channel form
* (gui) added optional `lightning:` scheme to payment request
We check that channel parameters are compliant with [BOLT 2](https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md) (this fixes#236).
We make sure that the counterparty chooses a decent `dust_limit`
because we want them to be able to publish their commitment, e.g. in a
data loss scenario. We also make sure that our configurable `dust_limit` isn't too low (this
fixes#234).
Also fixed our min `dust_limit` (542->546).
GUI:
* Using funding constants from `Channel`
* Also fixed an issue here `push` amount was compared to the max funding amount
instead of the actual `funding` amount