         sqlite3_bind_blob(sql2, 2, buf, Int32(buf.count), SQLITE_TRANSIENT)
         sqlite3_bind_blob(sql2, 3, [tx.pointee.txHash], Int32(MemoryLayout<UInt256>.size), SQLITE_TRANSIENT)
 
-        guard sqlite3_step(sql2) == SQLITE_OK else {
+        guard sqlite3_step(sql2) == SQLITE_DONE else {
             print(String(cString: sqlite3_errmsg(db)))
             return
         }

            sqlite3_bind_int64(sql2, 4, Int64(bitPattern: p.services))
            sqlite3_bind_int64(sql2, 5, Int64(bitPattern: p.timestamp))

            guard sqlite3_step(sql2) == SQLITE_OK else {
                print(String(cString: sqlite3_errmsg(db)))
                return
            }

            }
        }
        
        if sqlite3_errcode(db) != SQLITE_DONE { print(String(cString: sqlite3_errmsg(db))) }
    }
    
    func txDeleted(_ txHash: UInt256, notifyUser: Bool, recommendRescan: Bool) {
