Skip to content

Commit

Permalink
Fix for Bug #40
Browse files Browse the repository at this point in the history
by adding ClientPerConn in loop

Fixes guoger/stupid/#40

Signed-off-by: SamYuan1990 <yy19902439@126.com>
  • Loading branch information
SamYuan1990 authored and guoger committed Nov 6, 2020
1 parent 2cac834 commit bad525a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/infra/proposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func CreateProposers(conn, client int, nodes []Node, logger *log.Logger) *Propos
func (ps *Proposers) Start(signed []chan *Elements, processed chan *Elements, done <-chan struct{}, config Config) {
ps.logger.Infof("Start sending transactions.")
for i := 0; i < len(config.Endorsers); i++ {
for j := 0; j < config.NumOfConn; j++ {
go ps.workers[i][j].Start(signed[i], processed, done, len(config.Endorsers))
// peer connection should be config.ClientPerConn * config.NumOfConn
for k := 0; k < config.ClientPerConn; k++ {
for j := 0; j < config.NumOfConn; j++ {
go ps.workers[i][j].Start(signed[i], processed, done, len(config.Endorsers))
}
}
}
}
Expand Down

0 comments on commit bad525a

Please sign in to comment.