From c66fad600fec1ac65992d0b062ebda7ef4663ce0 Mon Sep 17 00:00:00 2001 From: muscle_boy Date: Wed, 12 Jun 2019 16:16:23 +0800 Subject: [PATCH] fix detach vote (#164) --- protocol/state/vote_result.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/protocol/state/vote_result.go b/protocol/state/vote_result.go index 129f3a35..e241bcff 100644 --- a/protocol/state/vote_result.go +++ b/protocol/state/vote_result.go @@ -120,7 +120,8 @@ func (v *VoteResult) DetachBlock(block *types.Block) error { return errors.New("block hash is not equals last block hash of vote result") } - for _, tx := range block.Transactions { + for i := len(block.Transactions) - 1; i >= 0; i-- { + tx := block.Transactions[i] for _, input := range tx.Inputs { unVoteInput, ok := input.TypedInput.(*types.UnvoteInput) if !ok { -- 2.11.0