Skip to content

Commit

Permalink
Merge "[FAB-1092] Illegal genesis message"
Browse files Browse the repository at this point in the history
  • Loading branch information
mastersingh24 authored and Gerrit Code Review committed Nov 19, 2016
2 parents 99c18a6 + 8a64889 commit 56a1dd6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions orderer/kafka/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"sync"
"time"

"golang.org/x/net/context"

"github.com/hyperledger/fabric/orderer/common/bootstrap/static"
"github.com/hyperledger/fabric/orderer/config"
cb "github.com/hyperledger/fabric/protos/common"
ab "github.com/hyperledger/fabric/protos/orderer"
"golang.org/x/net/context"

"github.com/golang/protobuf/proto"
)
Expand All @@ -47,12 +47,17 @@ type broadcasterImpl struct {
prevHash []byte
}

type broadcastSessionResponder struct {
queue chan *ab.BroadcastResponse
}

func newBroadcaster(conf *config.TopLevel) Broadcaster {
genesisBlock, _ := static.New().GenesisBlock()
return &broadcasterImpl{
producer: newProducer(conf),
config: conf,
batchChan: make(chan *cb.Envelope, conf.General.BatchSize),
messages: [][]byte{[]byte("genesis")},
messages: genesisBlock.GetData().Data,
nextNumber: 0,
}
}
Expand Down Expand Up @@ -98,7 +103,6 @@ func (b *broadcasterImpl) sendBlock() error {
b.prevHash = block.Header.Hash()

blockBytes, err := proto.Marshal(block)

if err != nil {
logger.Fatalf("Error marshaling block: %s", err)
}
Expand Down Expand Up @@ -154,10 +158,6 @@ func (b *broadcasterImpl) recvRequests(stream ab.AtomicBroadcast_BroadcastServer
}
}

type broadcastSessionResponder struct {
queue chan *ab.BroadcastResponse
}

func newBroadcastSessionResponder(context context.Context, stream ab.AtomicBroadcast_BroadcastServer, queueSize uint) *broadcastSessionResponder {
bsr := &broadcastSessionResponder{
queue: make(chan *ab.BroadcastResponse, queueSize),
Expand Down

0 comments on commit 56a1dd6

Please sign in to comment.