func (sg *MirrorSTHGetter) GetSTH(ctx context.Context) (*ct.SignedTreeHead, error) {
	currentRoot, err := getSignedLogRoot(ctx, sg.li.rpcClient, sg.li.logID, sg.li.LogPrefix)
	if err != nil {
		return nil, err
	}
	sth, err := sg.st.GetMirrorSTH(ctx, int64(currentRoot.TreeSize))  
	if err != nil {
		return nil, err
	}
	return sth, nil
}
GetSTH returns a known source log's STH with as large TreeSize and/or
timestamp as possible, but such that TreeSize <= Trillian log size. This is
to ensure that the mirror doesn't expose a "future" state of the log before
it is properly stored in Trillian.
package ctfe
import (
	"context"
	"crypto/sha256"
	"errors"
	"fmt"
	"github.com/golang/glog"
	ct "github.com/google/certificate-transparency-go"
	"github.com/google/trillian"
	"github.com/google/trillian/types"
	"google.golang.org/protobuf/encoding/prototext"
)
type contextKey string
var remoteQuotaCtxKey = contextKey("quotaUser")
type MirrorSTHStorage interface {
	GetMirrorSTH(ctx context.Context, maxTreeSize int64) (*ct.SignedTreeHead, error)
}
type STHGetter interface {
	GetSTH(ctx context.Context) (*ct.SignedTreeHead, error)
}
type FrozenSTHGetter struct {
	sth *ct.SignedTreeHead
}
func (sg *FrozenSTHGetter) GetSTH(ctx context.Context) (*ct.SignedTreeHead, error) {
	return sg.sth, nil
}
type LogSTHGetter struct {
	li    *logInfo
	cache SignatureCache
}
func (sg *LogSTHGetter) GetSTH(ctx context.Context) (*ct.SignedTreeHead, error) {
	currentRoot, err := getSignedLogRoot(ctx, sg.li.rpcClient, sg.li.logID, sg.li.LogPrefix)
	if err != nil {
		return nil, err
	}
	sth := &ct.SignedTreeHead{
		Version:   ct.V1,
		TreeSize:  uint64(currentRoot.TreeSize),
		Timestamp: uint64(currentRoot.TimestampNanos / 1000 / 1000),
	}
	copy(sth.SHA256RootHash[:], currentRoot.RootHash)
	err = signV1TreeHead(sg.li.signer, sth, &sg.cache)
	if err != nil || len(sth.TreeHeadSignature.Signature) == 0 {
		return nil, fmt.Errorf("failed to sign tree head: %v", err)
	}
	return sth, nil
}
type MirrorSTHGetter struct {
	li *logInfo
	st MirrorSTHStorage
}