Would it be safer not to make this assumption? The cluster would be larger, but since the algorithms are efficient, the performance difference shouldn’t be a problem. The MiniMiner
constructor would be simpler too. Even if currently we’re never given a outpoint that conflicts with a transaction not being replaced, could that possibly change in the future?
Initially, I thought that was I’m suggesting here wouldn’t work, because suppose that the transaction that our outpoint refers to (let’s call it the parent) has a low feerate, but the transaction we’re replacing (the parent’s existing child) has a very high feerate. If, contrary to what the code currently does, we ignore the fact that we’re replacing the child (we keep the child in the cluster, as if we’re spending a different output of the parent), then we might conclude that we don’t need to bump the parent’s fee – whereas we actually do, because the child will no longer exist!
But I think this won’t happen because rule 6 of our replacement policy requires the replacement transaction to have a higher feerate than all that it’s replacing.
- The replacement transaction’s feerate is greater than the feerates of all directly conflicting transactions.
So it seems like even if we (mistakenly) think that the existing child will remain and that it will bump the parent somewhat, it won’t bump it enough to meet our requested feerate, so we’ll still bump it (as required by our desired feerate).