OSDN Git Service

timerange not support timestamp for now
authorpaladz <453256728@qq.com>
Sun, 22 Apr 2018 15:49:05 +0000 (23:49 +0800)
committerpaladz <453256728@qq.com>
Sun, 22 Apr 2018 15:49:05 +0000 (23:49 +0800)
protocol/validation/tx.go
protocol/validation/tx_test.go

index 809c732..a577d72 100644 (file)
@@ -475,12 +475,7 @@ func checkTimeRange(tx *bc.Tx, block *bc.Block) error {
                return nil
        }
 
-       blockVal := block.Height
-       if tx.TimeRange > timeRangeGash {
-               blockVal = block.Timestamp
-       }
-
-       if tx.TimeRange < blockVal {
+       if tx.TimeRange < block.Height {
                return errBadTimeRange
        }
        return nil
index 70f1a7f..0de474c 100644 (file)
@@ -532,10 +532,6 @@ func TestTimeRange(t *testing.T) {
                        timeRange: 1521625824,
                        err:       false,
                },
-               {
-                       timeRange: 1421625824,
-                       err:       true,
-               },
        }
 
        block := &bc.Block{