Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/release 0.5.1 #83

Merged
merged 2 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion blockchain/service/bnb/bnb.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,10 @@ func (e *Bnb) SendReqByWs(blockChain int64, receiverCh chan string, sendCh chan
func (e *Bnb) SendReq(blockChain int64, reqBody string) (resp string, err error) {
reqBody = strings.Replace(reqBody, "\t", "", -1)
reqBody = strings.Replace(reqBody, "\n", "", -1)
var uri string
defer func() {
if err != nil {
e.log.Errorf("method:%v,blockChain:%v,req:%v,err:%v", "SendReq", blockChain, reqBody, err)
e.log.Errorf("method:%v,blockChain:%v,req:%v,err:%v,uri:%v", "SendReq", blockChain, reqBody, err, uri)
} else {
e.log.Printf("method:%v,blockChain:%v,req:%v,resp:%v", "SendReq", blockChain, reqBody, "ok")
}
Expand All @@ -429,6 +430,8 @@ func (e *Bnb) SendReq(blockChain int64, reqBody string) (resp string, err error)
return "", errors.New("blockchain node has not found")
}

uri = fmt.Sprintf("%v/%v", cluster.NodeUrl, cluster.NodeToken)

resp, err = e.blockChainClient.SendRequestToChain(cluster.NodeUrl, cluster.NodeToken, reqBody)
if err != nil {
cluster.ErrorCount += 1
Expand Down
5 changes: 4 additions & 1 deletion blockchain/service/btc/btc.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,10 @@ func (e *Btc) SendReqByWs(blockChain int64, receiverCh chan string, sendCh chan
func (e *Btc) SendReq(blockChain int64, reqBody string) (resp string, err error) {
reqBody = strings.Replace(reqBody, "\t", "", -1)
reqBody = strings.Replace(reqBody, "\n", "", -1)
var uri string
defer func() {
if err != nil {
e.log.Errorf("method:%v,blockChain:%v,req:%v,err:%v", "SendReq", blockChain, reqBody, err)
e.log.Errorf("method:%v,blockChain:%v,req:%v,err:%v,uri:%v", "SendReq", blockChain, reqBody, err, uri)
} else {
e.log.Printf("method:%v,blockChain:%v,req:%v,resp:%v", "SendReq", blockChain, reqBody, "ok")
}
Expand All @@ -218,6 +219,8 @@ func (e *Btc) SendReq(blockChain int64, reqBody string) (resp string, err error)
return "", errors.New("blockchain node has not found")
}

uri = fmt.Sprintf("%v/%v", cluster.NodeUrl, cluster.NodeToken)

resp, err = e.blockChainClient.SendRequestToChain(cluster.NodeUrl, cluster.NodeToken, reqBody)
if err != nil {
cluster.ErrorCount += 1
Expand Down
5 changes: 4 additions & 1 deletion blockchain/service/ether/ether.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,10 @@ func (e *Ether) SendReqByWs(blockChain int64, receiverCh chan string, sendCh cha
func (e *Ether) SendReq(blockChain int64, reqBody string) (resp string, err error) {
reqBody = strings.Replace(reqBody, "\t", "", -1)
reqBody = strings.Replace(reqBody, "\n", "", -1)
var uri string
defer func() {
if err != nil {
e.log.Errorf("method:%v,blockChain:%v,req:%v,err:%v", "SendReq", blockChain, reqBody, err)
e.log.Errorf("method:%v,blockChain:%v,req:%v,err:%v,uri:%v", "SendReq", blockChain, reqBody, err, uri)
} else {
e.log.Printf("method:%v,blockChain:%v,req:%v,resp:%v", "SendReq", blockChain, reqBody, "ok")
}
Expand All @@ -549,6 +550,8 @@ func (e *Ether) SendReq(blockChain int64, reqBody string) (resp string, err erro
return "", errors.New("blockchain node has not found")
}

uri = fmt.Sprintf("%v/%v", cluster.NodeUrl, cluster.NodeToken)

resp, err = e.blockChainClient.SendRequestToChain(cluster.NodeUrl, cluster.NodeToken, reqBody)
if err != nil {
cluster.ErrorCount += 1
Expand Down
4 changes: 3 additions & 1 deletion blockchain/service/filecoin/filecoin.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,10 @@ func (e *FileCoin) SendReqByWs(blockChain int64, receiverCh chan string, sendCh
func (e *FileCoin) SendReq(blockChain int64, reqBody string) (resp string, err error) {
reqBody = strings.Replace(reqBody, "\t", "", -1)
reqBody = strings.Replace(reqBody, "\n", "", -1)
var uri string
defer func() {
if err != nil {
e.log.Errorf("method:%v,blockChain:%v,req:%v,err:%v", "SendReq", blockChain, reqBody, err)
e.log.Errorf("method:%v,blockChain:%v,req:%v,err:%v,uri:%v", "SendReq", blockChain, reqBody, err, uri)
} else {
e.log.Printf("method:%v,blockChain:%v,req:%v,resp:%v", "SendReq", blockChain, reqBody, "ok")
}
Expand All @@ -416,6 +417,7 @@ func (e *FileCoin) SendReq(blockChain int64, reqBody string) (resp string, err e
//不存在节点
return "", errors.New("blockchain node has not found")
}
uri = fmt.Sprintf("%v/%v", cluster.NodeUrl, cluster.NodeToken)

resp, err = e.blockChainClient.SendRequestToChain(cluster.NodeUrl, cluster.NodeToken, reqBody)
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion blockchain/service/polygon/polygon_pos.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,10 @@ func (e *PolygonPos) SendReqByWs(blockChain int64, receiverCh chan string, sendC
func (e *PolygonPos) SendReq(blockChain int64, reqBody string) (resp string, err error) {
reqBody = strings.Replace(reqBody, "\t", "", -1)
reqBody = strings.Replace(reqBody, "\n", "", -1)
var uri string
defer func() {
if err != nil {
e.log.Errorf("method:%v,blockChain:%v,req:%v,err:%v", "SendReq", blockChain, reqBody, err)
e.log.Errorf("method:%v,blockChain:%v,req:%v,err:%v,uri:%v", "SendReq", blockChain, reqBody, err, uri)
} else {
e.log.Printf("method:%v,blockChain:%v,req:%v,resp:%v", "SendReq", blockChain, reqBody, "ok")
}
Expand All @@ -548,6 +549,7 @@ func (e *PolygonPos) SendReq(blockChain int64, reqBody string) (resp string, err
//不存在节点
return "", errors.New("blockchain node has not found")
}
uri = fmt.Sprintf("%v/%v", cluster.NodeUrl, cluster.NodeToken)

//if blockChain == 200 {
resp, err = e.blockChainClient.SendRequestToChain(cluster.NodeUrl, cluster.NodeToken, reqBody)
Expand Down
2 changes: 1 addition & 1 deletion blockchain/service/tron/tron.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func (t *Tron) SendReq(blockChain int64, reqBody string, url string) (resp strin
reqBody = strings.Replace(reqBody, "\n", "", -1)
defer func() {
if err != nil {
t.log.Errorf("method:%v,blockChain:%v,req:%v,err:%v", "SendReq", blockChain, reqBody, err)
t.log.Errorf("method:%v,blockChain:%v,req:%v,err:%v,uri:%v", "SendReq", blockChain, reqBody, err, url)
} else {
t.log.Printf("method:%v,blockChain:%v,req:%v,resp:%v", "SendReq", blockChain, reqBody, "ok")
}
Expand Down
4 changes: 3 additions & 1 deletion blockchain/service/xrp/xrp.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,10 @@ func (e *XRP) SendReqByWs(blockChain int64, receiverCh chan string, sendCh chan
func (e *XRP) SendReq(blockChain int64, reqBody string) (resp string, err error) {
reqBody = strings.Replace(reqBody, "\t", "", -1)
reqBody = strings.Replace(reqBody, "\n", "", -1)
var uri string
defer func() {
if err != nil {
e.log.Errorf("method:%v,blockChain:%v,req:%v,err:%v", "SendReq", blockChain, reqBody, err)
e.log.Errorf("method:%v,blockChain:%v,req:%v,err:%v,uri:%v", "SendReq", blockChain, reqBody, err, uri)
} else {
e.log.Printf("method:%v,blockChain:%v,req:%v,resp:%v", "SendReq", blockChain, reqBody, "ok")
}
Expand All @@ -364,6 +365,7 @@ func (e *XRP) SendReq(blockChain int64, reqBody string) (resp string, err error)
//不存在节点
return "", errors.New("blockchain node has not found")
}
uri = fmt.Sprintf("%v/%v", cluster.NodeUrl, cluster.NodeToken)

resp, err = e.blockChainClient.SendRequestToChain(cluster.NodeUrl, cluster.NodeToken, reqBody)
if err != nil {
Expand Down
18 changes: 12 additions & 6 deletions collect/service/cmd/chain/bnb/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ func (s *Service) GetBlockByHash(blockHash string, eLog *logrus.Entry, flag bool
for _, v := range txList {
receipt, err := s.GetReceipt(v.TxHash, eLog)
if err != nil {
eLog.Errorf("GetBlockByHash|BlockChainCode=%v,err=%v,blockHash=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), blockHash, v.TxHash)
//retry on monitor
task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: v.TxHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), v.TxHash, task)
eLog.Warnf("GetBlockByHash|BlockChainCode=%v,err=%v,blockHash=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), blockHash, v.TxHash)
} else {
m[receipt.TransactionHash] = receipt
}
Expand Down Expand Up @@ -195,7 +198,9 @@ func (s *Service) GetBlockByNumber(blockNumber string, eLog *logrus.Entry, flag
for _, v := range txList {
receipt, err := s.GetReceipt(v.TxHash, eLog)
if err != nil {
eLog.Errorf("GetBlockByNumber|BlockChainCode=%v,err=%v,blockNumber=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), blockNumber, v.TxHash)
task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: v.TxHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), v.TxHash, task)
eLog.Warnf("GetBlockByNumber|BlockChainCode=%v,err=%v,blockNumber=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), blockNumber, v.TxHash)
} else {
m[receipt.TransactionHash] = receipt
}
Expand Down Expand Up @@ -271,7 +276,9 @@ func (s *Service) GetTx(txHash string, eLog *logrus.Entry) *collect.TxInterface

receipt, err := s.GetReceipt(tx.TxHash, eLog)
if err != nil {
eLog.Errorf("GetTx|BlockChainCode=%v,err=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), tx.TxHash)
task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: txHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), txHash, task)
eLog.Warnf("GetTx|BlockChainCode=%v,err=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), tx.TxHash)
} else {
if receipt != nil {
bs, _ := json.Marshal(receipt.Receipt)
Expand Down Expand Up @@ -367,9 +374,8 @@ func (s *Service) GetReceipt(txHash string, eLog *logrus.Entry) (*collect.Receip
if err == nil {
return &collect.ReceiptInterface{TransactionHash: receipt.TransactionHash, Receipt: receipt}, nil
} else {
//nodeId, _ := util.GetLocalNodeId()
task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: txHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), txHash, task)
//task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: txHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
//_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), txHash, task)
return nil, errors.New("receipt is null")
}
}
Expand Down
20 changes: 14 additions & 6 deletions collect/service/cmd/chain/ether/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ func (s *Service) GetBlockByHash(blockHash string, eLog *logrus.Entry, flag bool
for _, v := range txList {
receipt, err := s.GetReceipt(v.TxHash, eLog)
if err != nil {
eLog.Errorf("GetBlockByHash|BlockChainCode=%v,err=%v,blockHash=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), blockHash, v.TxHash)
//retry on monitor
task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: v.TxHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), v.TxHash, task)
eLog.Warnf("GetBlockByHash|BlockChainCode=%v,err=%v,blockHash=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), blockHash, v.TxHash)
} else {
m[receipt.TransactionHash] = receipt
}
Expand Down Expand Up @@ -195,7 +198,10 @@ func (s *Service) GetBlockByNumber(blockNumber string, eLog *logrus.Entry, flag
for _, v := range txList {
receipt, err := s.GetReceipt(v.TxHash, eLog)
if err != nil {
eLog.Errorf("GetBlockByNumber|BlockChainCode=%v,err=%v,blockNumber=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), blockNumber, v.TxHash)
//retry on monitor
task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: v.TxHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), v.TxHash, task)
eLog.Warnf("GetBlockByNumber|BlockChainCode=%v,err=%v,blockNumber=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), blockNumber, v.TxHash)
} else {
m[receipt.TransactionHash] = receipt
}
Expand Down Expand Up @@ -271,7 +277,10 @@ func (s *Service) GetTx(txHash string, eLog *logrus.Entry) *collect.TxInterface

receipt, err := s.GetReceipt(tx.TxHash, eLog)
if err != nil {
eLog.Errorf("GetTx|BlockChainCode=%v,err=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), tx.TxHash)
//retry on monitor
task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: tx.TxHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), tx.TxHash, task)
eLog.Warnf("GetTx|BlockChainCode=%v,err=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), tx.TxHash)
} else {
if receipt != nil {
bs, _ := json.Marshal(receipt.Receipt)
Expand Down Expand Up @@ -367,9 +376,8 @@ func (s *Service) GetReceipt(txHash string, eLog *logrus.Entry) (*collect.Receip
if err == nil {
return &collect.ReceiptInterface{TransactionHash: receipt.TransactionHash, Receipt: receipt}, nil
} else {
//nodeId, _ := util.GetLocalNodeId()
task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: txHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), txHash, task)
//task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: txHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
//_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), txHash, task)
return nil, errors.New("receipt is null")
}
}
Expand Down
11 changes: 7 additions & 4 deletions collect/service/cmd/chain/filecoin/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ func (s *Service) GetBlockByHash(blockHash string, eLog *logrus.Entry, flag bool
m["blockHash"] = blockHash
receipt, err := s.GetReceipt(v.TxHash, eLog)
if err != nil {
eLog.Errorf("GetBlockByHash|BlockChainCode=%v,err=%v,blockHash=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), blockHash, v.TxHash)
task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: v.TxHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), v.TxHash, task)
eLog.Warnf("GetBlockByHash|BlockChainCode=%v,err=%v,blockHash=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), blockHash, v.TxHash)
} else {
if receipt != nil {
bs, _ := json.Marshal(receipt.Receipt)
Expand Down Expand Up @@ -231,6 +233,8 @@ func (s *Service) GetTx(txHash string, eLog *logrus.Entry) *collect.TxInterface

receipt, err := s.GetReceipt(hash, eLog)
if err != nil {
task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: txHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), txHash, task)
eLog.Errorf("GetTx|BlockChainCode=%v,err=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), hash)
} else {

Expand Down Expand Up @@ -357,9 +361,8 @@ func (s *Service) GetReceipt(txHash string, eLog *logrus.Entry) (*collect.Receip
if err == nil {
return &collect.ReceiptInterface{TransactionHash: receipt.TransactionHash, Receipt: receipt}, nil
} else {
//nodeId, _ := util.GetLocalNodeId()
task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: txHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), txHash, task)
//task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: txHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
//_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), txHash, task)
return nil, errors.New("receipt is null")
}
}
Expand Down
20 changes: 14 additions & 6 deletions collect/service/cmd/chain/polygonpos/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ func (s *Service) GetBlockByHash(blockHash string, eLog *logrus.Entry, flag bool
for _, v := range txList {
receipt, err := s.GetReceipt(v.TxHash, eLog)
if err != nil {
eLog.Errorf("GetBlockByHash|BlockChainCode=%v,err=%v,blockHash=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), blockHash, v.TxHash)
//retry on monitor
task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: v.TxHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), v.TxHash, task)
eLog.Warnf("GetBlockByHash|BlockChainCode=%v,err=%v,blockHash=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), blockHash, v.TxHash)
} else {
m[receipt.TransactionHash] = receipt
}
Expand Down Expand Up @@ -193,7 +196,10 @@ func (s *Service) GetBlockByNumber(blockNumber string, eLog *logrus.Entry, flag
for _, v := range txList {
receipt, err := s.GetReceipt(v.TxHash, eLog)
if err != nil {
eLog.Errorf("GetBlockByNumber|BlockChainCode=%v,err=%v,blockNumber=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), blockNumber, v.TxHash)
//retry on monitor
task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: v.TxHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), v.TxHash, task)
eLog.Warnf("GetBlockByNumber|BlockChainCode=%v,err=%v,blockNumber=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), blockNumber, v.TxHash)
} else {
m[receipt.TransactionHash] = receipt
}
Expand Down Expand Up @@ -267,7 +273,10 @@ func (s *Service) GetTx(txHash string, eLog *logrus.Entry) *collect.TxInterface

receipt, err := s.GetReceipt(tx.TxHash, eLog)
if err != nil {
eLog.Errorf("GetTx|BlockChainCode=%v,err=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), tx.TxHash)
//retry on monitor
task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: tx.TxHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), tx.TxHash, task)
eLog.Warnf("GetTx|BlockChainCode=%v,err=%v,txHash=%v", s.chain.BlockChainCode, err.Error(), tx.TxHash)
} else {
if receipt != nil {
bs, _ := json.Marshal(receipt.Receipt)
Expand Down Expand Up @@ -363,9 +372,8 @@ func (s *Service) GetReceipt(txHash string, eLog *logrus.Entry) (*collect.Receip
if err == nil {
return &collect.ReceiptInterface{TransactionHash: receipt.TransactionHash, Receipt: receipt}, nil
} else {
//nodeId, _ := util.GetLocalNodeId()
task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: txHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), txHash, task)
//task := collect.NodeTask{Id: time.Now().UnixNano(), BlockChain: s.chain.BlockChainCode, NodeId: s.nodeId, TxHash: txHash, TaskType: 1, TaskStatus: 0, CreateTime: time.Now(), LogTime: time.Now()}
//_ = s.store.StoreErrTxNodeTask(int64(s.chain.BlockChainCode), txHash, task)
return nil, errors.New("receipt is null")
}
}
Expand Down
Loading
Loading