Skip to content

Commit

Permalink
reject 0 priority fee transactions (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
TymKh authored Sep 24, 2024
1 parent 34078d6 commit 5cc5b1c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/request_sendrawtx.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package server

import (
"fmt"
"math/big"
"strings"
"time"

Expand Down Expand Up @@ -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()
}

0 comments on commit 5cc5b1c

Please sign in to comment.