Skip to content

Commit

Permalink
Update the syspar cache when TxRollback (#2119)
Browse files Browse the repository at this point in the history
* Update smart_contract.go

* Update block.go
  • Loading branch information
powerpook authored May 30, 2023
1 parent 77a7f1f commit 3e942fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/rollback/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func rollbackBlock(dbTx *sqldb.DbTransaction, block *block.Block) error {

switch t.Inner.(type) {
case *transaction.SmartTransactionParser:
t.Inner.(*transaction.SmartTransactionParser).DbTransaction = t.DbTransaction
if err = rollbackTransaction(t.Hash(), t.DbTransaction, logger); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion packages/transaction/smart_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (s *SmartTransactionParser) Action(in *InToCxt, out *OutCtx) (err error) {
}

func (s *SmartTransactionParser) TxRollback() error {
return nil
return syspar.SysUpdate(s.DbTransaction)
}

func (s *SmartTransactionParser) Marshal() ([]byte, error) {
Expand Down

0 comments on commit 3e942fb

Please sign in to comment.