Conversation
sstone
requested changes
Mar 28, 2018
| case u: UpdateFailMalformedHtlc => relayer ! CommandBuffer.CommandAck(u.channelId, u.id) | ||
| } | ||
| // TODO: be smarter and only consider commitments1.localChanges.signed and commitments1.remoteChanges.signed | ||
| htlcTxs.map { |
Member
There was a problem hiding this comment.
nitpick. map() instead of foreach()
| .flatMap { remotePerCommitmentSecret => | ||
| val remotePerCommitmentPoint = remotePerCommitmentSecret.toPoint | ||
| val remoteDelayedPaymentPubkey = Generators.derivePubKey(remoteParams.delayedPaymentBasepoint, remotePerCommitmentPoint) | ||
| val remoteRevocationPubkey = Generators.revocationPubKey(keyManager.revocationPoint(localParams.channelKeyPath).publicKey, remotePerCommitmentSecret.toPoint) |
Member
There was a problem hiding this comment.
remotePerCommitmentPoint instead of remotePerCommitmentSecret.toPoint
|
|
||
| // we watch outputs of the commitment tx that both parties may spend | ||
| val watchSpentQueue = mainPenaltyTx ++ claimHtlcTimeoutTxs ++ htlcTimeoutTxs | ||
| val watchSpentQueue = mainPenaltyTx ++ htlcPenaltyTxs ++ claimHtlcDelayedPenaltyTxs |
Member
There was a problem hiding this comment.
claimHtlcDelayedPenaltyTxs don't spend commitTx so we should not set a watch here
sstone
approved these changes
Mar 28, 2018
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously we were only stealing the remote's main output when they publish a revoked commit, and were relying on a sufficiently high
channel_reservedo deincentivize cheating.In order to also steal the htlc outputs, we need to handle both cases:
To do that, we need to be able to reconstruct htlc scripts (
htlcOfferedandhtlcReceived), therefore we need to storepaymentHashandcltvExpiryfor each htlc we sign. Note that this won't be needed in the future when we have MAST.