Don't delete payment task when receiving invalid secret request#3017
Conversation
hackaugusto
left a comment
There was a problem hiding this comment.
The fix looks correct to me.
The secret request is a message which can be cleared with a delivered, which is sent by the transport layer, so even if the first delivered failed to be delivered and the message was processed things are fine, the second message will not be processed but the delivered will be sent, clearing the target's queue.
Also, this is preserving the semantics of ignoring subsequent messages from the target which are invalid.
Important note: The message could be invalid for multiple reasons, the one that we want to prevent here is a target which is not following the protocol. However the definition of invalid will change, currently it required constant expiration and amount, which will most likely change to account for fees and other complications for mediated transfers.
|
Side note: I would not rely on github for documentation, I would either use the comments along side the code itself or the commit messages. |
hackaugusto
left a comment
There was a problem hiding this comment.
Could you please add a regression test?
[no ci integration]
hackaugusto
left a comment
There was a problem hiding this comment.
Approving, there are some changes that needs to be done on top of this (event emitting), but I will open a new PR for this.
What are these things? |
|
Deleting the payment task will lead to problems when unlocking locks related to the task.
@hackaugusto Can you have a look and see if this goes in the right direction? I'll work on a test in the meantime.
Fixes #3001