mining: Stop transactions losing their dependants.

This fixes a bug where a transaction would lose reference to other
transactions dependant on it when being considered for inclusion in a
new block template. The issue only occurs when the transaction being
considered triggers a change of priority queue ordering to ordering by
fee. It results in none of the dependant transactions being considered
for inclusion in the new block template.
This commit is contained in:
Jonathan Gillham 2016-06-06 04:35:53 +01:00 committed by Dave Collins
parent 18bb90b4ad
commit c2fb0cb18e

View file

@ -554,12 +554,8 @@ mempoolLoop:
prioItem := heap.Pop(priorityQueue).(*txPrioItem) prioItem := heap.Pop(priorityQueue).(*txPrioItem)
tx := prioItem.tx tx := prioItem.tx
// Grab the list of transactions which depend on this one (if // Grab the list of transactions which depend on this one (if any).
// any) and remove the entry for this transaction as it will
// either be included or skipped, but in either case the deps
// are no longer needed.
deps := dependers[*tx.Hash()] deps := dependers[*tx.Hash()]
delete(dependers, *tx.Hash())
// Enforce maximum block size. Also check for overflow. // Enforce maximum block size. Also check for overflow.
txSize := uint32(tx.MsgTx().SerializeSize()) txSize := uint32(tx.MsgTx().SerializeSize())