cryptocoinjs/btc-transaction — pull request #7 by sidazhang (2014-02-12 21:01:28+00:00)
Title: TransactionIn is able to accept coinbase TranscationIns (no prev out)

If the user does not pass in outpoint data (for example if you use the blockchain.info api)

There are apis that consider coinbase to have tx_hash of null. If a user uses those api to generate a TransactionIn, the user will run into the problems.

This pull request checks for the existence of prev_out, and if a txin does not reference a txout, it will assign coinbase tx hash and tx index to it (which is 32 zero bytes and index of -1 or 0xffffffff)