From 198d7b9c6fdf67f29438861d4140c9c32d43b703 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 15 Jul 2015 20:04:11 -0700 Subject: [PATCH] Fixes #93 --- state/execution.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/state/execution.go b/state/execution.go index 7097d7b75..a29905595 100644 --- a/state/execution.go +++ b/state/execution.go @@ -750,9 +750,12 @@ func ExecTx(blockCache *BlockCache, tx types.Tx, runCall bool, evc events.Fireab return types.ErrTxInvalidSignature } - // tx.Height must be equal to the next height - if tx.Height != _s.LastBlockHeight+1 { - return errors.New(Fmt("Invalid rebond height. Expected %v, got %v", _s.LastBlockHeight+1, tx.Height)) + // tx.Height must be in a suitable range + minRebondHeight := _s.LastBlockHeight - (validatorTimeoutBlocks / 2) + maxRebondHeight := _s.LastBlockHeight + 2 + if !((minRebondHeight <= tx.Height) && (tx.Height <= maxRebondHeight)) { + return errors.New(Fmt("Rebond height not in range. Expected %v <= %v <= %v", + minRebondHeight, tx.Height, maxRebondHeight)) } // Good!