there is a simpler way. I can't remember it off the top of my head but there is a config flag which turns off pruning.
Thanks.
I'm guessing it needs to re-download the blockchain otherwise any trx with old inputs will still be incomplete.
I've been keeping the mempool data cached so I can determine when a trx is first seen. Summing inputs and outputs when I put it in the cache is going to work ok. Just took me a few minutes to think of doing it that way. It's running now and I'm just waiting for a new block to make sure it works ok.
So what I do is poll bitcoind and any new mempool trx I grab and sum values and add to my cache. Then when a new block is detected I scan it for the cached trx. If it's in there then I add the diff between block it was cached and this block into my stats counters based on trx amount/fee and remove the trx from my cache. I think this works ok.
The only real messy bit now is deciding what the trx amount really is. I'm using the outputs summed for now but I know it's not correct. I can't read the mind of the sender.