Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Need to change LargerHashStateMachine to two commands #136
Right now it has three states commands, start, stop and exchangeIdentity. But in reality there are just two three states that only require two commands.
noIdentityExchange - this command would have us tell anyone who asks that we haven't picked anyone to exchange identities with.
exchangeIdentity - Means we have picked someone and if we have the smaller hash then we will advertise wrongPeer (e.g. anyone who talks to our network endpoint is the wrongPeer because the right peer has a larger hash and therefore we are reaching out to them) and if we have the larger hash then we go to waitForCB.
Calling noIdentityExchange just takes us out of identityExchange and back to advertising that we haven't picked who we want to exchange identities with.
So the current three commands are not necessary. But I don't want to do the surgery right now to simplify them down to two commands. Besides I suspect we will be doing some fairly heavy surgery on the identity exchange infrastructure when we bring in the new notifications (including things like adding TLS and possibly negotiating the first part of the protocol over BLE) so it's better to do it then.