From 395be8e5191441bbef55176588179f4a2aaa6599 Mon Sep 17 00:00:00 2001 From: charithabandi Date: Fri, 21 Feb 2025 16:08:08 -0600 Subject: [PATCH] BroadcastTx to return mempoolErr if mempool is full --- core/types/results.go | 1 + node/consensus/block.go | 2 +- node/types/interfaces.go | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/types/results.go b/core/types/results.go index c21851144..f42841c52 100644 --- a/core/types/results.go +++ b/core/types/results.go @@ -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. diff --git a/node/consensus/block.go b/node/consensus/block.go index b14f7a5af..d099389df 100644 --- a/node/consensus/block.go +++ b/node/consensus/block.go @@ -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 diff --git a/node/types/interfaces.go b/node/types/interfaces.go index 599654c0c..fb8a7232f 100644 --- a/node/types/interfaces.go +++ b/node/types/interfaces.go @@ -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