diff --git a/types/mempool/priority_nonce.go b/types/mempool/priority_nonce.go index 4d0735cfd8..abecfb1432 100644 --- a/types/mempool/priority_nonce.go +++ b/types/mempool/priority_nonce.go @@ -226,7 +226,7 @@ func (mp *PriorityNonceMempool[C]) Insert(ctx context.Context, tx sdk.Tx) error // if it's an unordered tx, we use the timeout timestamp instead of the nonce if unordered, ok := tx.(sdk.TxWithUnordered); ok && unordered.GetUnordered() { - timestamp := unordered.GetTimeoutTimeStamp().Unix() + timestamp := unordered.GetTimeoutTimeStamp().UnixNano() if timestamp < 0 { return errors.New("invalid timestamp value") } @@ -471,7 +471,7 @@ func (mp *PriorityNonceMempool[C]) Remove(tx sdk.Tx) error { // if it's an unordered tx, we use the timeout timestamp instead of the nonce if unordered, ok := tx.(sdk.TxWithUnordered); ok && unordered.GetUnordered() { - timestamp := unordered.GetTimeoutTimeStamp().Unix() + timestamp := unordered.GetTimeoutTimeStamp().UnixNano() if timestamp < 0 { return errors.New("invalid timestamp value") } diff --git a/types/mempool/sender_nonce.go b/types/mempool/sender_nonce.go index 4d4d33e545..2623fefd95 100644 --- a/types/mempool/sender_nonce.go +++ b/types/mempool/sender_nonce.go @@ -143,7 +143,7 @@ func (snm *SenderNonceMempool) Insert(_ context.Context, tx sdk.Tx) error { // if it's an unordered tx, we use the timeout timestamp instead of the nonce if unordered, ok := tx.(sdk.TxWithUnordered); ok && unordered.GetUnordered() { - timestamp := unordered.GetTimeoutTimeStamp().Unix() + timestamp := unordered.GetTimeoutTimeStamp().UnixNano() if timestamp < 0 { return errors.New("invalid timestamp value") } @@ -240,7 +240,7 @@ func (snm *SenderNonceMempool) Remove(tx sdk.Tx) error { // if it's an unordered tx, we use the timeout timestamp instead of the nonce if unordered, ok := tx.(sdk.TxWithUnordered); ok && unordered.GetUnordered() { - timestamp := unordered.GetTimeoutTimeStamp().Unix() + timestamp := unordered.GetTimeoutTimeStamp().UnixNano() if timestamp < 0 { return errors.New("invalid timestamp value") } diff --git a/types/tx_msg.go b/types/tx_msg.go index 6e014f8265..965554bee0 100644 --- a/types/tx_msg.go +++ b/types/tx_msg.go @@ -77,6 +77,8 @@ type ( TxWithTimeoutTimeStamp interface { Tx + // GetTimeoutTimeStamp gets the timeout timestamp for the tx. + // IMPORTANT: when the uint value is needed here, you MUST use UnixNano. GetTimeoutTimeStamp() time.Time }