A transaction need not have the proper hash to be included..., but if it does have the proper hash then the coindays destroyed count toward the block.
you want it to calculate coindays destroyed per transaction and use that to factor in as stake?
so if a tx destroys 1000 coin days, the PoW block gets an extra small % in coin representing the TaPoS?
There are no PoW blocks... if you look at the code in BitShares X you will see how I calculate it... but it comes down to this:
If a transaction includes the proper prior hash (one of the last 2 blocks) then its CDD are counted toward that block. Every block to be produced must have at least AVAILABLE_CDD / BLOCKS_PER_YEAR destroyed.
The AVAILABLE_CDD is calculated on a continuous basis as PREV_AVAILABLE_CDD - CDD_DESTROYED + MONEY SUPPLY every block.
Every block reserves the first transaction to be the 'miners transaction' in which the miner can contribute their own CDD. This transaction may only have one output.
Every block then contains a Miners Reward Transaction which must pay to the same address as the miners transaction and the amount paid is:
PAID_TO_MINER = TOTAL_FEES * MINERS_CDD / TOTAL_CDD (or less).
SHARE_SUPPLY -= TOTAL_FEES - PAID_TO_MINER
And that is the algorithm in a nutshell.