Bitcoind transaction data verification I find myself a victim of either my poor googling skills, or the lack of detail in the bitcoind docs.

I have a walletNotify script running on a full node that whenever a transaction to / from my wallet arrives, performs a getRawTransaction(txid, 1) on the passed transaction ID.

Now, if any of my addresses appears inside the vout array, I know that that transaction is a deposit. What I'd like to verify, is that I can indeed spend those bitcoins.

I read about non-standard transactions (specifically, unspendable transactions) and kinda panicked, so my questions are:


Does bitcoind perform any sort of verification on the "spendability" of the arriving bitcoins?
Is there any easy way of verifying this myself? is there any not-necessarily-easy way?


Thank you very much in advance!
Bitcoind only scrapes the blockchain for a few transaction types: Pay-to-pubkey, pay-to-pubkey-hash, and pay-to-script-hash. If you check https://en.bitcoin.it/wiki/Script you'll see many more script operators that can be used, so the protocol isn't just those three script types.

Since the scripts have a very definite form, your client will look for the cases where the payments are to address YOU own instead of others.

OP_DUP OP_HASH160 &lt;20 byte hash> OP_EQUALVERIFY OP_CHECKSIG  

If bitcoins were sent to this script but with other script operations at the end, your node wouldn't report them as spendable. 


Verifying this yourself is easy if you already have a working and completely correct script interpreter. You could look for non-standard outputs, since they do get mined on occasion.


However, reproducing bitcoind's script interpreter, with bug-for-bug compatibility is tricky. Certain clients have been forked from the blockchain by not following every quirk in the reference implementation. 

But if you have this, you could write your own node if you liked. Listen for new blocks from the network, or just from bitcoind. Use your script interpreter to ensure that transactions in new blocks are valid, are correctly signed, and so on. Once you're confident the blockchain you end up with is correct, you can parse for the cases that bitcoind ignores and spend them if you can.