Record transaction log
The code doesn't fulfill the requirements. You are supposed to log the last N orders. Instead you log all of them. The old orders shall be removed from the list as it grows beyond N.

Bug. The list is initialized with the size being set to N. However, at the beginning it may contain less than N elements. In the scenario
  List is empty
  An order is added
  get_last(2) is called

the loop
  for (int j = 0; j &lt; i - 1; j++)
  {
      current = current-&gt;prev;
  }

is guaranteed to access a null pointer.

The above loop complexity is \$O(N)\$.


All that said, I recommend to use not a list, but a circular buffer. No need to malloc anything, and get_last is executed in \$O(1)\$.