Skip to content

Commit

Permalink
Check on leasing state added.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeykiselev committed Nov 28, 2024
1 parent b233383 commit 010acba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/proto/actions_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package proto

import (
"github.com/pkg/errors"

"github.com/wavesplatform/gowaves/pkg/ride/ast"
)

Expand Down
6 changes: 6 additions & 0 deletions pkg/state/invoke_applier.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,12 @@ func (ia *invokeApplier) fallibleValidation(tx proto.Transaction, info *addlInvo
if err != nil {
return proto.DAppError, info.failedChanges, err
}
if !li.isActive() {
return proto.DAppError, info.failedChanges,
errors.Errorf(
"failed to cancel leasing %q, leasing is already cancelled", a.LeaseID.String(),
)
}
if senderPK != li.SenderPK {
return proto.DAppError, info.failedChanges,
errors.Errorf(
Expand Down

0 comments on commit 010acba

Please sign in to comment.