mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-18 05:05:12 +01:00
30 lines
674 B
Bash
30 lines
674 B
Bash
#!/bin/sh
|
|
|
|
. ./trace.sh
|
|
|
|
sql() {
|
|
trace "sqlite3 -cmd \".timeout 40000\" ${DB_FILE} \"${1}\""
|
|
sqlite3 -cmd ".timeout 40000" ${DB_FILE} "${1}"
|
|
|
|
if [ "$?" -ne 0 ]; then
|
|
# SQL didn't work, let's retry to be sure...
|
|
trace "SQL didn't work, let's retry..."
|
|
sqlite3 -cmd ".timeout 40000" ${DB_FILE} "${1}"
|
|
fi
|
|
|
|
return $?
|
|
}
|
|
|
|
sql_rawtx() {
|
|
trace "sqlite3 -cmd \".timeout 40000\" ${DB_FILE}_rawtx \"${1}\""
|
|
sqlite3 -cmd ".timeout 40000" ${DB_FILE}_rawtx "${1}"
|
|
|
|
if [ "$?" -ne 0 ]; then
|
|
# SQL didn't work, let's retry to be sure...
|
|
trace "SQL didn't work, let's retry..."
|
|
sqlite3 -cmd ".timeout 40000" ${DB_FILE}_rawtx "${1}"
|
|
fi
|
|
|
|
return $?
|
|
}
|