diff --git a/consensus/consensus_v2.go b/consensus/consensus_v2.go index 710c4e72b..4575e197e 100644 --- a/consensus/consensus_v2.go +++ b/consensus/consensus_v2.go @@ -310,16 +310,19 @@ func (consensus *Consensus) Start( case <-stopChan: return case <-ticker.C: + consensus.mutex.Lock() consensus.tick() + consensus.mutex.Unlock() } } }() + consensus.mutex.Lock() consensus.consensusTimeout[timeoutBootstrap].Start() consensus.getLogger().Info().Msg("[ConsensusMainLoop] Start bootstrap timeout (only once)") - // Set up next block due time. consensus.NextBlockDue = time.Now().Add(consensus.BlockPeriod) + consensus.mutex.Unlock() }() if consensus.dHelper != nil { diff --git a/scripts/go_executable_build.sh b/scripts/go_executable_build.sh index 6331aa522..9d111d79f 100755 --- a/scripts/go_executable_build.sh +++ b/scripts/go_executable_build.sh @@ -120,6 +120,7 @@ function build_only if [ "$STATIC" == "true" ]; then env GOOS=$GOOS GOARCH=$GOARCH go build $VERBOSE -gcflags="${GO_GCFLAGS}" -ldflags="-X main.version=v${VERSION} -X main.commit=${COMMIT} -X main.builtAt=${BUILTAT} -X main.builtBy=${BUILTBY} -w -extldflags \"-static -lm\"" -o $BINDIR/$bin $RACE $TRACEPTR ${SRC[$bin]} else +# env GOOS=$GOOS GOARCH=$GOARCH go build -race $VERBOSE -gcflags="${GO_GCFLAGS}" -ldflags="-X main.version=v${VERSION} -X main.commit=${COMMIT} -X main.builtAt=${BUILTAT} -X main.builtBy=${BUILTBY}" -o $BINDIR/$bin $RACE $TRACEPTR ${SRC[$bin]} env GOOS=$GOOS GOARCH=$GOARCH go build $VERBOSE -gcflags="${GO_GCFLAGS}" -ldflags="-X main.version=v${VERSION} -X main.commit=${COMMIT} -X main.builtAt=${BUILTAT} -X main.builtBy=${BUILTBY}" -o $BINDIR/$bin $RACE $TRACEPTR ${SRC[$bin]} fi fi