From 5cc5b1c24e1924faeae238985c2acfa4becd530d Mon Sep 17 00:00:00 2001 From: TymKh Date: Tue, 24 Sep 2024 17:50:53 +0200 Subject: [PATCH] reject 0 priority fee transactions (#157) --- 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() }