public GetNextTwoProtocolId ( |
||
other | ||
incrementOther | bool | |
return | ulong |
public ulong GetNextTwoProtocolId(Quorum other, bool incrementOther = true) { if (this == other) { return(GetNextProtocolId()); } if (!TwoQuorumProtocolIds.ContainsKey(other)) { TwoQuorumProtocolIds[other] = 0; } // if we are failing this assert, we need to expand the range Debug.Assert(TwoQuorumProtocolIds[other] <= ushort.MaxValue); ulong retId = ProtocolIdGenerator.TwoQuorumProtocolIdentifier(QuorumNumber, other.QuorumNumber, TwoQuorumProtocolIds[other]); TwoQuorumProtocolIds[other]++; // increment the id in the other quorum (necessary because a party may be part of both quorums) if (incrementOther) { other.GetNextTwoProtocolId(this, false); } return(retId); }
public ulong GetNextTwoProtocolId(Quorum other, bool incrementOther = true) { if (this == other) return GetNextProtocolId(); if (!TwoQuorumProtocolIds.ContainsKey(other)) TwoQuorumProtocolIds[other] = 0; // if we are failing this assert, we need to expand the range Debug.Assert(TwoQuorumProtocolIds[other] <= ushort.MaxValue); ulong retId = ProtocolIdGenerator.TwoQuorumProtocolIdentifier(QuorumNumber, other.QuorumNumber, TwoQuorumProtocolIds[other]); TwoQuorumProtocolIds[other]++; // increment the id in the other quorum (necessary because a party may be part of both quorums) if (incrementOther) other.GetNextTwoProtocolId(this, false); return retId; }