Skip to content

Commit

Permalink
fix tx repropagation
Browse files Browse the repository at this point in the history
  • Loading branch information
herr-seppia committed Aug 8, 2022
1 parent 3fca5b5 commit a5addb0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/core/mempool/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ func (m *Mempool) ProcessTx(srcPeerID string, msg message.Message) ([]bytes.Buff
return nil, errors.New("mempool is full, dropping transaction")
}

var h byte
// Initializing with MaxUint8 as 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"
var h byte = math.MaxUint8
if msg.Metadata() != nil {
h = msg.Metadata().KadcastHeight
}
Expand Down Expand Up @@ -495,9 +498,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)
Expand Down

0 comments on commit a5addb0

Please sign in to comment.