From 6800c3665a50f7ac624f4ecbaa474b8a81336143 Mon Sep 17 00:00:00 2001
From: obscuren <geffobscura@gmail.com>
Date: Tue, 23 Sep 2014 17:55:34 +0200
Subject: Re-added min gas price check on tx pool

---
 ethchain/transaction_pool.go | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'ethchain')

diff --git a/ethchain/transaction_pool.go b/ethchain/transaction_pool.go
index 9a6322432..0f7e85982 100644
--- a/ethchain/transaction_pool.go
+++ b/ethchain/transaction_pool.go
@@ -27,6 +27,8 @@ const (
 	minGasPrice = 1000000
 )
 
+var MinGasPrice = big.NewInt(10000000000000)
+
 type TxMsg struct {
 	Tx   *Transaction
 	Type TxMsgTy
@@ -103,6 +105,10 @@ func (pool *TxPool) ValidateTransaction(tx *Transaction) error {
 		return fmt.Errorf("[TXPL] Invalid recipient. len = %d", len(tx.Recipient))
 	}
 
+	if tx.GasPrice.Cmp(MinGasPrice) >= 0 {
+		return fmt.Errorf("Gas price to low. Require %v > Got %v", MinGasPrice, tx.GasPrice)
+	}
+
 	// Get the sender
 	//sender := pool.Ethereum.StateManager().procState.GetAccount(tx.Sender())
 	sender := pool.Ethereum.StateManager().CurrentState().GetAccount(tx.Sender())
-- 
cgit v1.2.3