jsha / blocktogether

Share your blocks and subscribe to others'
GNU General Public License v3.0
330 stars 68 forks source link

Use a transaction when updating blocks #123

Open jsha opened 9 years ago

jsha commented 9 years ago

Right now, in update-blocks, new blocks are diffed against old ones in-memory, after writing the 'complete' flag to the new block batch. Instead, we should create a transaction that covers writing all the diffs to various users' action queues and writing the complete flag on the new block batch. This would prevent a situation where update-blocks crashes before writing out all the fanout actions, and the actions get dropped on the floor.