Skip to content

Commit

Permalink
fix for quorum length 5 to 7
Browse files Browse the repository at this point in the history
  • Loading branch information
thewebchap committed Jul 17, 2024
1 parent d566e17 commit e3cc03e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions core/quorum.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,25 +82,25 @@ func (qm *QuorumManager) GetQuorum(t int, lastChar string) []string {
return nil
}
var quorumAddrList []string
quorumCount := 0
quorumAddrCount := 0
for _, q := range quorumList {
addr := string(q.PeerID + "." + q.DID)
quorumAddrList = append(quorumAddrList, addr)
quorumCount = quorumCount + 1
if quorumCount == 7 {
quorumAddrCount = quorumAddrCount + 1
if quorumAddrCount == 7 {
break
}
}
return quorumAddrList
case QuorumTypeTwo:
var quorumAddrList []string
quorumCount := 0
quorumAddrCount := 0
for _, q := range qm.ql {
peerID := qm.GetPeerID(q)
addr := string(peerID + "." + q)
quorumAddrList = append(quorumAddrList, addr)
quorumCount = quorumCount + 1
if quorumCount == 7 {
quorumAddrCount = quorumAddrCount + 1
if quorumAddrCount == 7 {
break
}
}
Expand Down
4 changes: 2 additions & 2 deletions core/quorum_initiator.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ func (c *Core) initiateConsensus(cr *ConensusRequest, sc *contract.Contract, dc
delete(c.pd, cr.ReqID)
c.qlock.Unlock()
}()
c.quorumCount = 0
c.noBalanceQuorumCount = 0
c.quorumCount = QuorumRequired - len(cr.QuorumList)
c.noBalanceQuorumCount = QuorumRequired - len(cr.QuorumList)
for _, a := range cr.QuorumList {
//This part of code is trying to connect to the quorums in quorum list, where various functions are called to pledge the tokens
//and checking of transaction by the quorum i.e. consensus for the transaction. Once the quorum is connected, it pledges and
Expand Down

0 comments on commit e3cc03e

Please sign in to comment.