diff --git a/src/mining/coinbase.go b/src/mining/coinbase.go index eec2369..4128c46 100644 --- a/src/mining/coinbase.go +++ b/src/mining/coinbase.go @@ -61,8 +61,10 @@ func AddWitnessCommitmentX(coinbaseTx *txn.Transaction, // coinbase if(t.Vin[0].IsCoinbase){ wtxids = append(wtxids, zeroHash) - } else { + } else if(t.HasWitness()) { wtxids = append(wtxids, [32]byte(utils.ReverseBytes(t.WitnessHash()))) + } else { + wtxids = append(wtxids, [32]byte(utils.ReverseBytes(t.TxHash()))) } }