-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
Background
The handler ReadyForInvitation::react(const event::Recv<protocol_wire::JoinContract> & e) currently checks that
- the peer is in fact a buyer: if this guard fails, we throw
InvitedToJoinContractByNonBuyer - the peer is inviting us with reference to the most up to date terms we have announced: if this guard fails we trigger callback
_invitedToOutdatedContract.
If the first guard fails, then we know the peer has misbehaved, while the latter guard may be triggered by honest peers if they have not yet seen our most recent terms on their end of the wire.
Problem
We are not checking that the buyer has actually most recently advertised terms which are compatible with our most recent terms, if not, then we should be ignoring the message. Just checking the buy mode is not sufficient.