From c2fb0cb18e9685d63bb67bf29f2f3d2c6cd3177b Mon Sep 17 00:00:00 2001 From: Jonathan Gillham Date: Mon, 6 Jun 2016 04:35:53 +0100 Subject: [PATCH] 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. --- mining.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mining.go b/mining.go index db400bbf..8db0090d 100644 --- a/mining.go +++ b/mining.go @@ -554,12 +554,8 @@ mempoolLoop: prioItem := heap.Pop(priorityQueue).(*txPrioItem) tx := prioItem.tx - // Grab the list of transactions which depend on this one (if - // 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. + // Grab the list of transactions which depend on this one (if any). deps := dependers[*tx.Hash()] - delete(dependers, *tx.Hash()) // Enforce maximum block size. Also check for overflow. txSize := uint32(tx.MsgTx().SerializeSize())