ledger: have collapseTransactions not collapse transactions whose depth is >= the current rounds roots depth
@@ -587,7 +587,7 @@ func (l *Ledger) collapseTransactions(round uint64, tx *Transaction, logging boo
if _, seen := visited[parentID]; !seen {
visited[parentID] = struct{}{}
- if parent, exists := l.graph.lookupTransactionByID(parentID); exists {
+ if parent, exists := l.graph.lookupTransactionByID(parentID); exists && parent.Depth > root.Depth {
aq.PushBack(parent)
} else {
return snapshot, errors.Errorf("missing ancestor %x to correctly collapse down ledger state from critical transaction %x", parentID, tx.ID)
@@ -648,7 +648,7 @@ func (l *Ledger) rewardValidators(ss *avl.Tree, tx *Transaction, logging bool) e
var stakes []uint64
var totalStake uint64
- visited := make(map[common.AccountID]struct{})
+ visited := make(map[common.TransactionID]struct{})
q := AcquireQueue()
defer ReleaseQueue(q)
