diff --git a/core/peer/peer.go b/core/peer/peer.go index 7471d33c40e..de8848f5fa8 100644 --- a/core/peer/peer.go +++ b/core/peer/peer.go @@ -231,6 +231,7 @@ func CreateChainFromBlock(cb *common.Block) error { peerLogger.Errorf("Unable to get genesis block committed into the ledger, chainID %v", cid) return err } + return createChain(cid, ledger, cb) } diff --git a/core/scc/cscc/configure.go b/core/scc/cscc/configure.go index 0bf3f342665..99e90b716b1 100644 --- a/core/scc/cscc/configure.go +++ b/core/scc/cscc/configure.go @@ -27,6 +27,7 @@ import ( "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/core/chaincode/shim" "github.com/hyperledger/fabric/core/peer" + "github.com/hyperledger/fabric/events/producer" pb "github.com/hyperledger/fabric/protos/peer" "github.com/hyperledger/fabric/protos/utils" "github.com/op/go-logging" @@ -120,6 +121,11 @@ func joinChain(blockBytes []byte) pb.Response { peer.InitChain(chainID) + if err := producer.SendProducerBlockEvent(block); err != nil { + msg := fmt.Sprintf("Error sending block event %s", err) + return shim.Error(msg) + } + return shim.Success(nil) }