Fix nil pointer dereference.

Ran into by @toddfries and brought up on IRC.
This commit is contained in:
Josh Rickmar 2014-03-18 16:41:01 -05:00
parent d179af8ecf
commit 29fef9ffd2

View file

@ -1307,7 +1307,7 @@ func (rt *RecvTxOut) Addresses(net btcwire.BitcoinNet) (btcscript.ScriptClass,
// IsCoinbase returns whether the received transaction output is an output // IsCoinbase returns whether the received transaction output is an output
// a coinbase transaction. // a coinbase transaction.
func (rt *RecvTxOut) IsCoinbase() bool { func (rt *RecvTxOut) IsCoinbase() bool {
if rt.recvTxOut.block != nil { if rt.recvTxOut.block == nil {
return false return false
} }
return rt.recvTxOut.block.Index == 0 return rt.recvTxOut.block.Index == 0