MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / queryTxState

Method queryTxState

blockproducer/chain_io.go:123–145  ·  view source on GitHub ↗
(hash hash.Hash)

Source from the content-addressed store, hash-verified

121}
122
123func (c *Chain) queryTxState(hash hash.Hash) (state pi.TransactionState, err error) {
124 c.RLock()
125 defer c.RUnlock()
126 var ok bool
127
128 if state, ok = c.headBranch.queryTxState(hash); ok {
129 return
130 }
131
132 var (
133 count int
134 querySQL = `SELECT COUNT(*) FROM "indexed_transactions" WHERE "hash" = ?`
135 )
136 if err = c.storage.Reader().QueryRow(querySQL, hash.String()).Scan(&count); err != nil {
137 return pi.TransactionStateNotFound, err
138 }
139
140 if count > 0 {
141 return pi.TransactionStateConfirmed, nil
142 }
143
144 return pi.TransactionStateNotFound, nil
145}
146
147func (c *Chain) queryAccountSQLChainProfiles(account proto.AccountAddress) (profiles []*types.SQLChainProfile, err error) {
148 var dbs []proto.DatabaseID

Callers

nothing calls this directly

Calls 4

QueryRowMethod · 0.80
ReaderMethod · 0.65
ScanMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected