bitcoinjs/bitcoinjs-lib — pull request #330 by bezreyhan (2014-12-12 21:02:44+00:00)
Title: transaction.addInput checks if sequence is NULL

I ran into the situation where I was creating adding inputs to a transaction builder and provided the inputs prevTx, index, ands script. I set the sequence to null.

sequence = null
txb.addInput(prevTx, index, sequence, script)

Since Transaction.addInput will only check if sequence is *undefined*, a TypeError is thrown

TypeError: Expected Number, got null

It's, a common practice, at least for me, put *null* for optional values that you would like to leave empty. This is also one of the reasons why coffeescript's existential operator (?) checks for null as well as undefined.

This isn't a big deal but I thought it would save others from receiving an error.