Commit c169bc80 authored by mdj33's avatar mdj33 Committed by vipwzw

veify notify asap

parent e925de1d
...@@ -35,10 +35,6 @@ func (client *client) addLocalBlock(height int64, block *pt.ParaLocalDbBlock) er ...@@ -35,10 +35,6 @@ func (client *client) addLocalBlock(height int64, block *pt.ParaLocalDbBlock) er
} }
func (client *client) checkCommitTxSuccess(txs []*pt.TxDetail) { func (client *client) checkCommitTxSuccess(txs []*pt.TxDetail) {
if atomic.LoadInt32(&client.isCaughtUp) != 1 {
return
}
curTx := client.commitMsgClient.getCurrentTx() curTx := client.commitMsgClient.getCurrentTx()
if curTx == nil { if curTx == nil {
return return
...@@ -52,6 +48,10 @@ func (client *client) checkCommitTxSuccess(txs []*pt.TxDetail) { ...@@ -52,6 +48,10 @@ func (client *client) checkCommitTxSuccess(txs []*pt.TxDetail) {
} }
} }
} else { } else {
//如果正在追赶,则暂时不去主链查找,减少耗时
if atomic.LoadInt32(&client.isCaughtUp) != 1 {
return
}
//去主链查询 //去主链查询
receipt, _ := client.QueryTxOnMainByHash(curTx.Hash()) receipt, _ := client.QueryTxOnMainByHash(curTx.Hash())
if receipt != nil && receipt.Receipt.Ty == types.ExecOk { if receipt != nil && receipt.Receipt.Ty == types.ExecOk {
...@@ -59,6 +59,11 @@ func (client *client) checkCommitTxSuccess(txs []*pt.TxDetail) { ...@@ -59,6 +59,11 @@ func (client *client) checkCommitTxSuccess(txs []*pt.TxDetail) {
} }
} }
//如果没找到且当前正在追赶,则不计数,如果找到了,即便当前在追赶,也通知
if !txMap[string(curTx.Hash())] && atomic.LoadInt32(&client.isCaughtUp) != 1 {
return
}
client.commitMsgClient.verifyNotify(txMap[string(curTx.Hash())]) client.commitMsgClient.verifyNotify(txMap[string(curTx.Hash())])
} }
......
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