🎨 Improve blocktree
This commit is contained in:
parent
5f1999d68e
commit
a8b3f6cc25
1 changed files with 8 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue