Commit f7c93036 authored by 贾浩@五瓣科技's avatar 贾浩@五瓣科技

update

parent 53370b76
...@@ -15,6 +15,8 @@ import ( ...@@ -15,6 +15,8 @@ import (
) )
func (d *Dao) LoginByServer(byteKey []byte, userAddress, userId string) (txHash common.Hash, err error) { func (d *Dao) LoginByServer(byteKey []byte, userAddress, userId string) (txHash common.Hash, err error) {
d.executorLock.Lock()
defer d.executorLock.Unlock()
instance, err := aon_user.NewAonUser(common.HexToAddress(d.c.Chain.UserContract), d.ethClient) instance, err := aon_user.NewAonUser(common.HexToAddress(d.c.Chain.UserContract), d.ethClient)
if err != nil { if err != nil {
return common.Hash{}, err return common.Hash{}, err
......
...@@ -11,6 +11,7 @@ import ( ...@@ -11,6 +11,7 @@ import (
"github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
log "github.com/sirupsen/logrus"
"gorm.io/driver/postgres" "gorm.io/driver/postgres"
"gorm.io/gorm" "gorm.io/gorm"
"gorm.io/gorm/logger" "gorm.io/gorm/logger"
...@@ -25,6 +26,7 @@ type Dao struct { ...@@ -25,6 +26,7 @@ type Dao struct {
ethRPC *rpc.Client ethRPC *rpc.Client
gasSenderNonce uint64 gasSenderNonce uint64
gasSenderLock sync.Mutex gasSenderLock sync.Mutex
executorLock sync.Mutex
gasPrice *big.Int gasPrice *big.Int
} }
...@@ -48,7 +50,7 @@ func New(_c *config.Config) (dao *Dao, err error) { ...@@ -48,7 +50,7 @@ func New(_c *config.Config) (dao *Dao, err error) {
if err != nil { if err != nil {
return return
} }
log.Infoln("chainId:", chainId)
dao.chainId = chainId dao.chainId = chainId
if _c.PGSQL.CertFile != "" { if _c.PGSQL.CertFile != "" {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment