func (m *MemoryBlockDB) GetChainTip() (*chainhash.Hash, error) {
	m.lock.Lock()
	defer m.lock.Unlock()
	return &m.tip, nil
}
GetChainTip gets the tip of the chain.
package db
import (
	"fmt"
	"sync"
	"github.com/phoreproject/synapse/chainhash"
	"github.com/phoreproject/synapse/primitives"
	"github.com/prysmaticlabs/go-ssz"
)
type MemoryBlockDB struct {
	blocks     map[chainhash.Hash]primitives.ShardBlock
	blockNodes map[chainhash.Hash]ShardBlockNodeDisk
	finalizedHead chainhash.Hash
	tip           chainhash.Hash
	lock sync.Mutex
}
func (m *MemoryBlockDB) SetBlockNode(n *ShardBlockNodeDisk) error {
	m.lock.Lock()
	defer m.lock.Unlock()
	m.blockNodes[n.BlockHash] = *n
	return nil
}
func (m *MemoryBlockDB) SetFinalizedHead(c chainhash.Hash) error {
	m.lock.Lock()
	defer m.lock.Unlock()
	m.finalizedHead = c
	return nil
}
func (m *MemoryBlockDB) GetFinalizedHead() (*chainhash.Hash, error) {
	m.lock.Lock()
	defer m.lock.Unlock()
	return &m.finalizedHead, nil
}
func (m *MemoryBlockDB) SetChainTip(c chainhash.Hash) error {
	m.lock.Lock()
	defer m.lock.Unlock()
	m.tip = c
	return nil
}