Skip to content

Commit c8beeea

Browse files
jonfung-dydxroy-dydx
authored andcommitted
exclude MsgBatchCancel from mempool (#28)
1 parent a7ed4c2 commit c8beeea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mempool/dydx_helpers.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
// IsShortTermClobOrderTransaction returns true if the provided `tx` is a
1111
// Cosmos transaction containing a short-term `MsgPlaceOrder` or
12-
// short-term `MsgCancelOrder` message.
12+
// short-term `MsgCancelOrder` or `MsgBatchCancel` message.
1313
func IsShortTermClobOrderTransaction(
1414
tx types.Tx,
1515
mempoolLogger log.Logger,
@@ -44,6 +44,10 @@ func IsShortTermClobOrderTransaction(
4444
}
4545
return msgCancelOrder.OrderId.IsShortTermOrder()
4646
}
47+
if cosmosTx.Body.Messages[0].TypeUrl == "/dydxprotocol.clob.MsgBatchCancel" {
48+
// MsgBatchCancel only processes short term order cancellations as of right now.
49+
return true
50+
}
4751
}
4852

4953
return false

0 commit comments

Comments
 (0)