Skip to content

Commit

Permalink
Skip old version billing
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeliu committed Mar 28, 2019
1 parent 86333a4 commit 5a8c774
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blockproducer/metastate.go
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,8 @@ func (s *metaState) updateBilling(tx *types.UpdateBilling) (err error) {
err = errors.Wrap(ErrDatabaseNotFound, "update billing failed")
return
}
if tx.Range.From >= tx.Range.To || newProfile.LastUpdatedHeight != tx.Range.From {

if tx.Version > 0 && (tx.Range.From >= tx.Range.To || newProfile.LastUpdatedHeight != tx.Range.From) {
err = errors.Wrapf(ErrInvalidRange,
"update billing within range %d:(%d, %d]",
newProfile.LastUpdatedHeight, tx.Range.From, tx.Range.To)
Expand Down

0 comments on commit 5a8c774

Please sign in to comment.