diff options
author | obscuren <geffobscura@gmail.com> | 2014-06-12 03:56:59 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-06-12 03:56:59 +0800 |
commit | 8a2e50ab2a6c903a6ab3ab10a74c37e1f3b8f3f1 (patch) | |
tree | 3cf67a559ef450500ddfd7df9d457f3e1a994caf /ethchain/transaction_pool.go | |
parent | 9ee6295c752a518603de01e4feaec787c61a5dcf (diff) | |
parent | 1938bfcddfd2722880a692c59cad344b611711c8 (diff) | |
download | dexon-8a2e50ab2a6c903a6ab3ab10a74c37e1f3b8f3f1.tar.gz dexon-8a2e50ab2a6c903a6ab3ab10a74c37e1f3b8f3f1.tar.zst dexon-8a2e50ab2a6c903a6ab3ab10a74c37e1f3b8f3f1.zip |
Merge branch 'develop' into interop
Conflicts:
peer.go
Diffstat (limited to 'ethchain/transaction_pool.go')
-rw-r--r-- | ethchain/transaction_pool.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ethchain/transaction_pool.go b/ethchain/transaction_pool.go index bc7bde797..6220f29a3 100644 --- a/ethchain/transaction_pool.go +++ b/ethchain/transaction_pool.go @@ -22,6 +22,7 @@ type TxMsgTy byte const ( TxPre = iota TxPost + minGasPrice = 1000000 ) type TxMsg struct { @@ -181,6 +182,12 @@ func (pool *TxPool) ValidateTransaction(tx *Transaction) error { return fmt.Errorf("[TXPL] Insufficient amount in sender's (%x) account", tx.Sender()) } + if tx.IsContract() { + if tx.GasPrice.Cmp(big.NewInt(minGasPrice)) < 0 { + return fmt.Errorf("[TXPL] Gasprice to low, %s given should be at least %d.", tx.GasPrice, minGasPrice) + } + } + // Increment the nonce making each tx valid only once to prevent replay // attacks |