Post
Topic
Board Bitcoin Discussion
Re: Bitcoin Block Explorer
by
bitcool
on 08/02/2011, 15:18:42 UTC
Code:
SELECT sum(outputs.value) FROM outputs LEFT JOIN inputs ON (outputs.tx=inputs.prev AND outputs.index=inputs.index) WHERE inputs IS NULL;
       sum
------------------
 5343100.00000000
(1 row)
My database updating script will refuse to accept a double-spend, though I doubt I will catch something that Bitcoin itself doesn't.
Thanks. Looks this is what I've been looking for. I don't quite understand your table definition though. Does "WHERE inputs IS NULL" restrict result only to coin-generation transactions?