Skip to content

Commit

Permalink
Make getHistory timeTarget be limited to past targets
Browse files Browse the repository at this point in the history
  • Loading branch information
bandreghetti committed Jun 9, 2021
1 parent 2485cac commit b5d7942
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions transactions/readAssetHistory.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ var ReadAssetHistory = Transaction{
} else {
response := make(map[string]interface{})
target := timeTarget.(time.Time)

// Check if time target is in the future
if target.After(time.Now()) {
return nil, errors.NewCCError("timeTarget must be in the past", 400)
}
closestTime := time.Time{}

for historyIterator.HasNext() {
Expand Down

0 comments on commit b5d7942

Please sign in to comment.