From b2ed6dce8b10a0c4695108bca1b0a6167c84a351 Mon Sep 17 00:00:00 2001 From: Nguyen Ba Tam Date: Sat, 11 Aug 2018 11:37:46 +0700 Subject: [PATCH] Reject all transactions to blocksigners with rpc ipc --- internal/ethapi/api.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index e900694fce..c49c317024 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1208,6 +1208,11 @@ func (args *SendTxArgs) toTransaction() *types.Transaction { // submitTransaction is a helper function that submits tx to txPool and logs a message. func submitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (common.Hash, error) { + if tx.To() != nil && tx.To().String() == common.BlockSigners { + log.Debug("Dont Allow submitTransaction to BlockSigners through api ", tx.String()) + return tx.Hash(), nil + } + log.Debug("Allow submitTransaction through api ", tx.String()) if err := b.SendTx(ctx, tx); err != nil { return common.Hash{}, err }