bookkeeper-tutorial
bookkeeper-tutorial copied to clipboard
Race condition
If Dice.playdice() drops into the follow branch before the takeLeadership callback occurs then the program hangs without generating any dice rolls.
This is because the first block of code in follow() has a loop condition that never breaks out. ie "while (ledgers == null) "
A potential solution is to change the condition to so that one the leadership "while (ledgers == null && !leader)"
Or is this additional check wrong for some reason?
See pull request
@Johnlon for some reason github didn't send me a notification for this. I'm updating the tutorial for the new api, so will add this fix as I go.