github.com/decred/dcrlnd@v0.7.6/neutrinocache/cacheable_block.go (about)

     1  package cache
     2  
     3  import "github.com/decred/dcrd/dcrutil/v4"
     4  
     5  // CacheableBlock is a wrapper around the btcutil.Block type which provides a
     6  // Size method used by the cache to target certain memory usage.
     7  type CacheableBlock struct {
     8  	*dcrutil.Block
     9  }
    10  
    11  // Size returns size of this block in bytes.
    12  func (c *CacheableBlock) Size() (uint64, error) {
    13  	return uint64(c.Block.MsgBlock().SerializeSize()), nil
    14  }