-const (
- //TxPrefix is wallet database transactions prefix
- TxPrefix = "TXS:"
- //TxIndexPrefix is wallet database tx index prefix
- TxIndexPrefix = "TID:"
- //TxIndexPrefix is wallet database global tx index prefix
- GlobalTxIndexPrefix = "GTID:"
-)
-
-var errAccntTxIDNotFound = errors.New("account TXID not found")
-
-func formatKey(blockHeight uint64, position uint32) string {
- return fmt.Sprintf("%016x%08x", blockHeight, position)
-}
-
-func calcAnnotatedKey(formatKey string) []byte {
- return []byte(TxPrefix + formatKey)
-}
-
-func calcDeleteKey(blockHeight uint64) []byte {
- return []byte(fmt.Sprintf("%s%016x", TxPrefix, blockHeight))
-}
-
-func calcTxIndexKey(txID string) []byte {
- return []byte(TxIndexPrefix + txID)
-}
-
-func calcGlobalTxIndexKey(txID string) []byte {
- return []byte(GlobalTxIndexPrefix + txID)
-}
-
-func calcGlobalTxIndex(blockHash *bc.Hash, position uint64) []byte {
- txIdx := make([]byte, 40)
- copy(txIdx[:32], blockHash.Bytes())
- binary.BigEndian.PutUint64(txIdx[32:], position)
- return txIdx
-}
-