From 758c1631912aebd81a45ff66d633f2c08b98e153 Mon Sep 17 00:00:00 2001 From: Antony Shchukin Date: Fri, 4 May 2018 23:17:58 +0300 Subject: [PATCH] fix: rule #1 allowed contracts addresses --- core/tx_pool.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/tx_pool.go b/core/tx_pool.go index 19578ec9a0..0231280bd1 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -108,7 +108,7 @@ var ( type TxStatus uint const ( - TxStatusUnknown TxStatus = iota + TxStatusUnknown TxStatus = iota TxStatusQueued TxStatusPending TxStatusIncluded @@ -588,12 +588,10 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error { return ErrInvalidSender } - if from.Hex() != pool.superheroAddress.Hex() || pool.allowedTo[tx.To().Hex()] { - return errors.New("aimed over rules") + if from.Hex() != pool.superheroAddress.Hex() && !pool.allowedTo[tx.To().Hex()] { + return errors.New("SONM sidechain rule #1: you are not prepare uranus, transaction not allowed") } - crypto.CreateAddress(from, 1) - // Drop non-local transactions under our own minimal accepted gas price local = local || pool.locals.contains(from) // account may be local even if the transaction arrived from the network if !local && pool.gasPrice.Cmp(tx.GasPrice()) > 0 {