That moment when you look into your code because you think there is a bug in there since it didn't return what you expected.
But then it turns out, it did exactly what it's supposed to do, my expectation was wrong, lol
best moments as a programmer
details
implemented prediction market settlement and was confused why a user received so many sats since i checked their winning share amount before settlement and it was quite low.
turns out that user had a lot of pending sell orders and shares are immediately deducted from user balances if sold to prevent double-spends. these pending sell orders then got canceled due to the market settling down (= trading halted); increasing the user balance for this share again and these shares turned out to be winning shares, lol
edit: nvm, i think there is indeed a bug 👀🤔
I think the mind of programmers can be funny and fascinating 🧐
reply