Documentation ¶
Index ¶
- Variables
- func DeleteAll()
- func DeleteClosedBlock(hash [32]byte)
- func DeleteClosedTx(transaction protocol.Transaction)
- func DeleteOpenBlock(hash [32]byte)
- func DeleteOpenTx(transaction protocol.Transaction)
- func GetAccountFromHash(hash [32]byte) *protocol.Account
- func Init(dbname string)
- func ReadAllOpenTxs() (allOpenTxs []protocol.Transaction)
- func ReadClosedBlock(hash [32]byte) (block *protocol.Block)
- func ReadClosedTx(hash [32]byte) (transaction protocol.Transaction)
- func ReadOpenBlock(hash [32]byte) (block *protocol.Block)
- func ReadOpenTx(hash [32]byte) (transaction protocol.Transaction)
- func TearDown()
- func WriteClosedBlock(block *protocol.Block) (err error)
- func WriteClosedTx(transaction protocol.Transaction) (err error)
- func WriteOpenBlock(block *protocol.Block) (err error)
- func WriteOpenTx(transaction protocol.Transaction)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DeleteClosedBlock ¶
func DeleteClosedBlock(hash [32]byte)
func DeleteClosedTx ¶
func DeleteClosedTx(transaction protocol.Transaction)
func DeleteOpenBlock ¶
func DeleteOpenBlock(hash [32]byte)
There exist open/closed buckets and closed tx buckets for all types (open txs are in volatile storage)
func DeleteOpenTx ¶
func DeleteOpenTx(transaction protocol.Transaction)
func GetAccountFromHash ¶
Needed by miner and p2p package
func ReadAllOpenTxs ¶
func ReadAllOpenTxs() (allOpenTxs []protocol.Transaction)
Needed for the miner to prepare a new block
func ReadClosedBlock ¶
func ReadClosedTx ¶
func ReadClosedTx(hash [32]byte) (transaction protocol.Transaction)
Personally I like it better to test (which tx type it is) here, and get returned the interface. Simplifies the code
func ReadOpenBlock ¶
Always return nil if requested hash is not in the storage. This return value is then checked against by the caller
func ReadOpenTx ¶
func ReadOpenTx(hash [32]byte) (transaction protocol.Transaction)
func WriteClosedBlock ¶
func WriteClosedTx ¶
func WriteClosedTx(transaction protocol.Transaction) (err error)
func WriteOpenBlock ¶
func WriteOpenTx ¶
func WriteOpenTx(transaction protocol.Transaction)
Changing the "tx" shortcut here and using "transaction" to distinguish between bolt's transactions
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.