diff --git a/pkg/core/mempool/mempool.go b/pkg/core/mempool/mempool.go index 1d167b09a..94de6c3a6 100644 --- a/pkg/core/mempool/mempool.go +++ b/pkg/core/mempool/mempool.go @@ -214,7 +214,12 @@ func (m *Mempool) ProcessTx(srcPeerID string, msg message.Message) ([]bytes.Buff return nil, errors.New("mempool is full, dropping transaction") } - var h byte + // Initializing `h=0` or `h=KadcastInitialHeight` will not work. + // This because `h` will be decremented by the kadcast writer as per + // it's interpreted as "the kadcast height at which it's been received" + // Hence, `h=0` will not be broadcasted at all and + // `h=KadcastInitialHeight` will miss the broadcast to the first bucket + var h byte = math.MaxUint8 if msg.Metadata() != nil { h = msg.Metadata().KadcastHeight } @@ -495,10 +500,6 @@ func (m Mempool) processGetMempoolTxsBySizeRequest(r rpcbus.Request) (interface{ // kadcastTx (re)propagates transaction in kadcast network. func (m *Mempool) kadcastTx(t TxDesc) error { - if t.kadHeight > config.KadcastInitialHeight { - return errors.New("invalid kadcast height") - } - /// repropagate buf := new(bytes.Buffer) if err := transactions.Marshal(buf, t.tx); err != nil {