OSDN Git Service

fix: waive charging storage gas for cross-chain (#162)
authorHAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Wed, 12 Jun 2019 08:12:21 +0000 (16:12 +0800)
committerPaladz <yzhu101@uottawa.ca>
Wed, 12 Jun 2019 08:12:21 +0000 (16:12 +0800)
* fix: do not charge storage gas for cross-chain

* fix: fix skip-storage-gas attack

protocol/validation/tx.go

index d7cc42b..68bac2e 100644 (file)
@@ -255,6 +255,7 @@ func checkValid(vs *validationState, e bc.Entry) (err error) {
                if err = checkValidDest(&vs2, e.WitnessDestination); err != nil {
                        return errors.Wrap(err, "checking cross-chain input destination")
                }
+               vs.gasStatus.StorageGas = 0
 
        case *bc.Spend:
                if e.SpentOutputId == nil {