Commit 4ccc580a authored by mdj33's avatar mdj33 Committed by vipwzw

modify super manager approve process

parent d2f105a7
...@@ -226,14 +226,14 @@ function para_configkey() { ...@@ -226,14 +226,14 @@ function para_configkey() {
} }
function query_tx() { function query_tx() {
block_wait "${1}" 2 block_wait "${1}" 1
local times=100 local times=100
while true; do while true; do
ret=$(${1} tx query -s "${2}" | jq -r ".tx.hash") ret=$(${1} tx query -s "${2}" | jq -r ".tx.hash")
echo "query hash is ${2}, return ${ret} " echo "query hash is ${2}, return ${ret} "
if [ "${ret}" != "${2}" ]; then if [ "${ret}" != "${2}" ]; then
block_wait "${1}" 2 block_wait "${1}" 1
times=$((times - 1)) times=$((times - 1))
if [ $times -le 0 ]; then if [ $times -le 0 ]; then
echo "query tx=$2 failed" echo "query tx=$2 failed"
......
...@@ -341,10 +341,12 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error) ...@@ -341,10 +341,12 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
return nil, err return nil, err
} }
consensHeight := data.(*pt.ParacrossStatus).Height consensHeight := data.(*pt.ParacrossStatus).Height
if a.exec.GetMainHeight() > consensHeight+confStopBlocks { //return err to stop tx pass to para chain
clog.Info("paracross.nodeVote, super manager pass", "currHeight", a.height, "consensHeight", consensHeight, "confHeight", confStopBlocks) if a.exec.GetMainHeight() <= consensHeight + confStopBlocks {
superManagerPass = true clog.Error("paracross.nodeVote, super manager height not reach", "currHeight", a.exec.GetMainHeight(), "consensHeight", consensHeight, "confHeight", confStopBlocks)
return nil, pt.ErrParaConsensStopBlocksNotReach
} }
superManagerPass = true
} }
//超级用户投yes票,共识停止了一定高度就可以通过,防止当前所有授权节点都忘掉私钥场景 //超级用户投yes票,共识停止了一定高度就可以通过,防止当前所有授权节点都忘掉私钥场景
......
...@@ -49,4 +49,6 @@ var ( ...@@ -49,4 +49,6 @@ var (
ErrParaNodeGroupStatusWrong = errors.New("ErrParaNodeGroupStatusWrong") ErrParaNodeGroupStatusWrong = errors.New("ErrParaNodeGroupStatusWrong")
//ErrParaNodeGroupAddrNotMatch group addrs not match with apply //ErrParaNodeGroupAddrNotMatch group addrs not match with apply
ErrParaNodeGroupAddrNotMatch = errors.New("ErrParaNodeGroupAddrNotMatch") ErrParaNodeGroupAddrNotMatch = errors.New("ErrParaNodeGroupAddrNotMatch")
//ErrParaConsensStopBlocksNotReach consensus stop blocks not reach
ErrParaConsensStopBlocksNotReach = errors.New("ErrParaConsensStopBlocksNotReach")
) )
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