diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-03-19 15:02:06 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:23 +0800 |
commit | 3dadb841289a41303f84ce96a0478a4f3cb8364c (patch) | |
tree | eaffc06fc4afc8bb1aca5926902be3247f3b8a68 /dex | |
parent | 22314d387813c467038e3cb5c87f99c9d731aeef (diff) | |
download | go-tangerine-3dadb841289a41303f84ce96a0478a4f3cb8364c.tar go-tangerine-3dadb841289a41303f84ce96a0478a4f3cb8364c.tar.gz go-tangerine-3dadb841289a41303f84ce96a0478a4f3cb8364c.tar.bz2 go-tangerine-3dadb841289a41303f84ce96a0478a4f3cb8364c.tar.lz go-tangerine-3dadb841289a41303f84ce96a0478a4f3cb8364c.tar.xz go-tangerine-3dadb841289a41303f84ce96a0478a4f3cb8364c.tar.zst go-tangerine-3dadb841289a41303f84ce96a0478a4f3cb8364c.zip |
core: vm: add extra checks to prevent DKG spamming (#272)
Add two maps to check the uniqueness of DKGMasterPublicKey and DKGComplaints to
prevent malicious actors from spamming it.
Diffstat (limited to 'dex')
-rw-r--r-- | dex/governance.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/dex/governance.go b/dex/governance.go index 35c5b4174..c2f2918b1 100644 --- a/dex/governance.go +++ b/dex/governance.go @@ -85,11 +85,16 @@ func (d *DexconGovernance) sendGovTx(ctx context.Context, data []byte) error { // be included in time. gasPrice = new(big.Int).Mul(gasPrice, big.NewInt(10)) + gasLimit, err := core.IntrinsicGas(data, false, false) + if err != nil { + return err + } + tx := types.NewTransaction( nonce, vm.GovernanceContractAddress, big.NewInt(0), - uint64(10000000), + gasLimit+vm.GovernanceActionGasCost, gasPrice, data) |