-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
update_add_htlc
tlv to its own file
And use a tlv stream for pay-to-open to be future-proof. Fix a bug where the `blinding` point of an HTLC was not encoded.
- Loading branch information
Showing
6 changed files
with
96 additions
and
51 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package fr.acinq.lightning.wire | ||
|
||
import fr.acinq.bitcoin.PublicKey | ||
import fr.acinq.bitcoin.io.Input | ||
import fr.acinq.bitcoin.io.Output | ||
|
||
sealed class UpdateAddHtlcTlv : Tlv { | ||
/** Blinding ephemeral public key that should be used to derive shared secrets when using route blinding. */ | ||
data class Blinding(val publicKey: PublicKey) : UpdateAddHtlcTlv() { | ||
override val tag: Long get() = Blinding.tag | ||
|
||
override fun write(out: Output) = LightningCodecs.writeBytes(publicKey.value, out) | ||
|
||
companion object : TlvValueReader<Blinding> { | ||
const val tag: Long = 0 | ||
override fun read(input: Input): Blinding = Blinding(PublicKey(LightningCodecs.bytes(input, 33))) | ||
} | ||
} | ||
} |
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