Commit Graph

7 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
de3af9b0c0
htlcswitch: modify Bandwidth() method on links to use more accurate accoutning
In this commit, we modify the existing implementation of the
Bandwidth() method on the default ChannelLink implementation to use
much tighter accounting. Before this commit, there was a bug wherein if
the link restarted with pending un-settled HTLC’s, and one of them was
settled, then the bandwidth wouldn’t properly be updated to reflect
this fact.

To fix this, we’ve done away with the manual accounting and instead
grab the current balances from two sources: the set of active HTLC’s
within the overflow queue, and the report from the link itself which
includes the pending HTLC’s and factors in the amount we’d need to (or
not need to) pay in fees for each HTLC.
2017-11-10 19:51:02 -08:00
Olaoluwa Osuntokun
12ae63101d
Htlcswitch: rename Deobfuscator and Obfuscator interfaces
This commit renames the Deobfuscator interface to ErrorDecrypter and
the Obfuscator interface to ErrorEncrypter. With this rename, the
purpose of these two interfaces are a bit clearer.

Additionally, DecryptError (which was formerly Deobfuscate) now
directly returns an ForwardingError type instead of the
lnwire.FailureMessage.
2017-10-10 22:19:19 -07:00
Olaoluwa Osuntokun
8a51b1a0c6
Htlcswitch: switch all accounting and forwarding decisions to use mSAT's 2017-08-22 00:53:04 -07:00
Olaoluwa Osuntokun
a04fa76a4c
lnwire+htlcswitch: minor grammatical, formatting fixes after error PR 2017-07-14 20:08:37 -07:00
Andrey Samokhvalov
2d378b3280 htlcswitch+router: add onion error obfuscation
Within the network, it's important that when an HTLC forwarding failure
occurs, the recipient is notified in a timely manner in order to ensure
that errors are graceful and not unknown. For that reason with
accordance to BOLT №4 onion failure obfuscation have been added.
2017-07-14 19:08:04 -07:00
Olaoluwa Osuntokun
1f5a4fcb8e
htlcswitch: change over all internal indexes to use short channel ID's 2017-06-16 23:49:46 +02:00
Andrey Samokhvalov
b86409cdb3 htlcswitch: recreate hlcswitch from scratch
This commit gives the start for making the htlc manager and htlc switch
testable. The testability of htlc switch have been achieved by mocking
all external subsystems. The concrete list of updates:

1. create standalone package for htlc switch.
2. add "ChannelLink" interface, which represent the previous htlc link.
3. add "Peer" interface, which represent the remote node inside our
subsystem.
4. add htlc switch config to htlc switch susbystem, which stores the
handlers which are not elongs to any of the above interfaces.

With this commit we are able test htlc switch even without having
the concrete implementation of Peer, ChannelLink structures, they will
be added later.
2017-05-31 11:06:08 -07:00