// NewBlockTree create buckets in blockdb if does not exist. func NewBlockTree() *BlockTree { blocks, err := bucket.New([]byte("blocks"), db) if err != nil { panic(err) } tree, err := bucket.New([]byte("block_tree"), db) if err != nil { panic(err) } return &BlockTree{ blocks: blocks, tree: tree, } }
// New create a transaction db instance. func newTransactionsBkt(db *bolt.DB) (*transactions, error) { txBkt, err := bucket.New([]byte("transactions"), db) if err != nil { return nil, nil } return &transactions{bkt: txBkt}, nil }
func newAddressUx(db *bolt.DB, name []byte) (*addressUx, error) { bkt, err := bucket.New(name, db) if err != nil { return nil, err } return &addressUx{bkt}, nil }
func NewBlockSigs() *BlockSigs { sigs, err := bucket.New([]byte("block_sigs"), db) if err != nil { panic(err) } return &BlockSigs{ Sigs: sigs, } }