🎨 Improve blocktree

This commit is contained in:
Daniel 2024-07-02 11:07:30 +08:00
parent 5f1999d68e
commit a8b3f6cc25
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -306,6 +306,10 @@ func ExistBlockTree(id string) bool {
func ExistBlockTrees(ids []string) (ret map[string]bool) {
ret = map[string]bool{}
if 1 > len(ids) {
return
}
for _, id := range ids {
ret[id] = false
}
@ -330,6 +334,10 @@ func ExistBlockTrees(ids []string) (ret map[string]bool) {
func GetBlockTrees(ids []string) (ret map[string]*BlockTree) {
ret = map[string]*BlockTree{}
if 1 > len(ids) {
return
}
sqlStmt := "SELECT * FROM blocktrees WHERE id IN ('" + strings.Join(ids, "','") + "')"
rows, err := db.Query(sqlStmt)
if nil != err {