graph: create only single ptr to root on reset()
@@ -376,8 +376,10 @@ func (g *Graph) markTransactionAsComplete(tx *Transaction) error {
}
func (g *Graph) Reset(newRound *Round) {
- g.transactions[newRound.Root.ID] = &newRound.Root
- g.createTransactionIndices(&newRound.Root)
+ ptr := &newRound.Root
+
+ g.transactions[newRound.Root.ID] = ptr
+ g.createTransactionIndices(ptr)
oldRoot := g.transactions[g.rootID]
