@@ -554,10 +554,20 @@ impl Encodable for Transaction {
554554 break ;
555555 }
556556 }
557- // Forcing have_witness to false for AssetUnlock, as currently Core doesn't support BIP141 SegWit.
557+ // Forcing have_witness to false for special transaction types that legitimately have no inputs.
558+ // Dash Core doesn't support BIP141 SegWit.
558559 if self . tx_type ( ) == TransactionType :: AssetUnlock {
559560 have_witness = false ;
560561 }
562+ if self . tx_type ( ) == TransactionType :: QuorumCommitment {
563+ have_witness = false ;
564+ }
565+ if self . tx_type ( ) == TransactionType :: MnhfSignal {
566+ have_witness = false ;
567+ }
568+ if self . tx_type ( ) == TransactionType :: Coinbase {
569+ have_witness = false ;
570+ }
561571 if !have_witness {
562572 len += self . input . consensus_encode ( w) ?;
563573 len += self . output . consensus_encode ( w) ?;
@@ -594,7 +604,8 @@ impl Decodable for Transaction {
594604 let input = Vec :: < TxIn > :: consensus_decode_from_finite_reader ( r) ?;
595605 // segwit
596606 let mut segwit = input. is_empty ( ) ;
597- // Forcing segwit to false for AssetUnlock, as currently Core doesn't support BIP141 SegWit.
607+ // Forcing segwit to false for special transaction types that legitimately have no inputs.
608+ // Dash Core doesn't support BIP141 SegWit.
598609 if special_transaction_type == TransactionType :: AssetUnlock {
599610 segwit = false ;
600611 }
@@ -604,6 +615,9 @@ impl Decodable for Transaction {
604615 if special_transaction_type == TransactionType :: MnhfSignal {
605616 segwit = false ;
606617 }
618+ if special_transaction_type == TransactionType :: Coinbase {
619+ segwit = false ;
620+ }
607621 if segwit {
608622 let segwit_flag = u8:: consensus_decode_from_finite_reader ( r) ?;
609623 match segwit_flag {
0 commit comments