Merge pull request #133 from nguyenbatam/reject_all_txs_to_blocksigners_with_rpc_ipc

Reject all transactions to blocksigners with rpc ipc
This commit is contained in:
Tuna 2018-08-11 17:18:45 +07:00 committed by GitHub
commit 92a6000ba6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1208,6 +1208,9 @@ func (args *SendTxArgs) toTransaction() *types.Transaction {
// submitTransaction is a helper function that submits tx to txPool and logs a message. // 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) { func submitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (common.Hash, error) {
if tx.To() != nil && tx.To().String() == common.BlockSigners {
return common.Hash{}, errors.New("Dont allow transaction sent to BlockSigners smart contract via API")
}
if err := b.SendTx(ctx, tx); err != nil { if err := b.SendTx(ctx, tx); err != nil {
return common.Hash{}, err return common.Hash{}, err
} }