>The JD staking wallet does often have two outputs which are able to stake at the same time, and so only the first of them gets to stake.
It may be so, but I was more curious about the the actual hashing events being serialized. Lets say a a wallet had 1 million inputs, then how long would it take hash all 1 million inputs? My guess is the first 1/2 million would have a greater probability to stake and not orphaned then then last 1/2 million just due to the time it takes to do hashing.
Doesn't the 1st person who has a valid stake and propagates over the network win?
Oh, yes. If it takes you more than 16 seconds to check all your outputs then you're going to be missing out of some stakes. I am able to check about 15k outputs per second, and have around 46k outputs attempting to stake at any given time, so it takes 3 or 4 seconds to check for stakes. You wouldn't want to have a million outputs unless you had a significantly faster staking machine. You would want to combine some of those outputs into a more manageable set.
I'm not sure what happens if one of your peers sends you a block while you are working through your outputs. Maybe you stop working and use the peer's block, or maybe you keep working hoping to find an output of your own which can compete with the peer's block.