From 36a98275d06c05a3fb89b86365a3249a65114c7a Mon Sep 17 00:00:00 2001 From: Tymur Khrushchov Date: Tue, 24 Sep 2024 15:38:49 +0200 Subject: [PATCH] disallow 0 priority fee transactions --- server/request_sendrawtx.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/request_sendrawtx.go b/server/request_sendrawtx.go index 0ccf4bb..aa34715 100644 --- a/server/request_sendrawtx.go +++ b/server/request_sendrawtx.go @@ -2,6 +2,7 @@ package server import ( "fmt" + "math/big" "strings" "time" @@ -130,5 +131,10 @@ func (r *RpcRequest) handle_sendRawTransaction() { return } + // do it as the last step, in case it is used as cancellation + if r.tx.GasTipCap().Cmp(big.NewInt(0)) == 0 { + r.writeRpcError("transaction underpriced: gas tip cap 0, minimum needed 1", types.JsonRpcInvalidRequest) + return + } r.sendTxToRelay() }