Documentation
¶
Index ¶
- type DB
- func (db *DB) Clear() error
- func (db *DB) Close() error
- func (db *DB) Delete(key []byte) error
- func (db *DB) FetchBalance(decryptionKey []byte) (uint64, uint64, error)
- func (db *DB) FetchInputs(decryptionKey []byte, amount int64) ([]*transactions.Input, int64, error)
- func (db *DB) FetchTxRecords() ([]txrecords.TxRecord, error)
- func (db *DB) Get(key []byte) ([]byte, error)
- func (db *DB) GetPubKey(keyImage []byte) ([]byte, error)
- func (db *DB) GetWalletHeight() (uint64, error)
- func (db *DB) Put(key, value []byte) error
- func (db *DB) PutInput(encryptionKey []byte, pubkey ristretto.Point, ...) error
- func (db *DB) PutKeyImage(keyImage []byte, outputKey []byte) error
- func (db *DB) PutTxRecord(tx transactions.Transaction, direction txrecords.Direction, ...) error
- func (db *DB) RemoveInput(pubkey []byte, keyImage []byte) error
- func (db *DB) UpdateLockedInputs(decryptionKey []byte, height uint64) error
- func (db *DB) UpdateWalletHeight(newHeight uint64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB encapsulates a leveldb.DB storage
func (*DB) FetchBalance ¶
FetchBalance calculates the balance
func (*DB) FetchInputs ¶
FetchInputs fetches transaction inputs amounting to the specified amount. Inputs are decrypted using a decryption key (view key)
func (*DB) FetchTxRecords ¶
FetchTxRecords transaction records
func (*DB) GetWalletHeight ¶
GetWalletHeight returns the height of the blockchain known to the wallet
func (*DB) PutInput ¶
func (db *DB) PutInput(encryptionKey []byte, pubkey ristretto.Point, amount, mask, privKey ristretto.Scalar, unlockHeight uint64) error
PutInput inserts a UTXO input (i.e. a Ristretto point) in the DB
func (*DB) PutKeyImage ¶
PutKeyImage saves the transaction's key image used to prevent double spending
func (*DB) PutTxRecord ¶
func (db *DB) PutTxRecord(tx transactions.Transaction, direction txrecords.Direction, privView *key.PrivateView) error
PutTxRecord saves the transaction record on the DB
func (*DB) RemoveInput ¶
RemoveInput removes a UTXO input from the DB
func (*DB) UpdateLockedInputs ¶
UpdateLockedInputs will set the lockheight for an input to 0 if the given `height` is greater or equal than the input lockheight, signifying that this input is unlocked.
func (*DB) UpdateWalletHeight ¶
UpdateWalletHeight updates the wallet height