2019-10-01 12:22:30 -03:00

15 lines
397 B
Go

package cache
import "github.com/btcsuite/btcutil"
// CacheableBlock is a wrapper around the btcutil.Block type which provides a
// Size method used by the cache to target certain memory usage.
type CacheableBlock struct {
*btcutil.Block
}
// Size returns size of this block in bytes.
func (c *CacheableBlock) Size() (uint64, error) {
return uint64(c.Block.MsgBlock().SerializeSize()), nil
}