Skip to content

Commit

Permalink
BroadcastTx to return mempoolErr if mempool is full
Browse files Browse the repository at this point in the history
  • Loading branch information
charithabandi committed Feb 21, 2025
1 parent a43523e commit 18cf2fc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/types/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ var (
ErrInvalidNonce = errors.New("invalid nonce")
ErrInvalidAmount = errors.New("invalid amount")
ErrInsufficientBalance = errors.New("insufficient balance")
ErrMempoolFull = errors.New("mempool is full")
)

// TxResult is the result of a transaction execution on chain.
Expand Down
2 changes: 1 addition & 1 deletion node/consensus/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (ce *ConsensusEngine) BroadcastTx(ctx context.Context, tx *ktypes.Transacti
if rejected {
return &ktypes.ResultBroadcastTx{
Hash: txHash,
}, types.ErrMempoolFull
}, ktypes.ErrMempoolFull
}

// Announce the transaction to the network only if not previously announced
Expand Down
1 change: 0 additions & 1 deletion node/types/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ var (
ErrStillProcessing = errors.New("block still being executed")
ErrNoResponse = errors.New("stream closed without response")
ErrPeersNotFound = errors.New("no peers available")
ErrMempoolFull = errors.New("mempool is full")
)

const HashLen = types.HashLen
Expand Down

0 comments on commit 18cf2fc

Please sign in to comment.