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

Function deleteTxs

blockproducer/storage.go:262–280  ·  view source on GitHub ↗
(txs []pi.Transaction)

Source from the content-addressed store, hash-verified

260}
261
262func deleteTxs(txs []pi.Transaction) storageProcedure {
263 var hs = make([]hash.Hash, len(txs))
264 for i, v := range txs {
265 hs[i] = v.Hash()
266 }
267 return func(tx *sql.Tx) (err error) {
268 var stmt *sql.Stmt
269 if stmt, err = tx.Prepare(`DELETE FROM "txPool" WHERE "hash"=?`); err != nil {
270 return
271 }
272 defer stmt.Close()
273 for _, v := range hs {
274 if _, err = stmt.Exec(v.String()); err != nil {
275 return
276 }
277 }
278 return
279 }
280}
281
282func updateAccount(account *types.Account) storageProcedure {
283 var (

Callers 1

Calls 5

HashMethod · 0.65
PrepareMethod · 0.65
CloseMethod · 0.65
ExecMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected