-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor sphinx payment packet (#2052)
We previously created restrictions in Sphinx.scala to only allow using it for two types of onions: a 1300 bytes one for HTLCs and a 400 bytes one for trampoline. This doesn't make sense anymore. The latest version of trampoline allows any onion size, and onion messages also allow any onion size. The Sphinx protocol doesn't care either about the size of the payload. Another reason to remove it is that it wasn't working that well with pattern matching because of type erasure. So now the caller must explicitly set the length of the payload, which is more flexible. Verifying that the correct length is used is deferred to higher level components.
- Loading branch information
Showing
10 changed files
with
296 additions
and
311 deletions.
There are no files selected for viewing
292 changes: 135 additions & 157 deletions
292
eclair-core/src/main/scala/fr/acinq/eclair/crypto/Sphinx.scala
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.