Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions dash/src/blockdata/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,20 @@ impl Encodable for Transaction {
break;
}
}
// Forcing have_witness to false for AssetUnlock, as currently Core doesn't support BIP141 SegWit.
// Forcing have_witness to false for special transaction types that legitimately have no inputs.
// Dash Core doesn't support BIP141 SegWit.
if self.tx_type() == TransactionType::AssetUnlock {
have_witness = false;
}
if self.tx_type() == TransactionType::QuorumCommitment {
have_witness = false;
}
if self.tx_type() == TransactionType::MnhfSignal {
have_witness = false;
}
if self.tx_type() == TransactionType::Coinbase {
have_witness = false;
}
if !have_witness {
len += self.input.consensus_encode(w)?;
len += self.output.consensus_encode(w)?;
Expand Down Expand Up @@ -594,7 +604,8 @@ impl Decodable for Transaction {
let input = Vec::<TxIn>::consensus_decode_from_finite_reader(r)?;
// segwit
let mut segwit = input.is_empty();
// Forcing segwit to false for AssetUnlock, as currently Core doesn't support BIP141 SegWit.
// Forcing segwit to false for special transaction types that legitimately have no inputs.
// Dash Core doesn't support BIP141 SegWit.
if special_transaction_type == TransactionType::AssetUnlock {
segwit = false;
}
Expand All @@ -604,6 +615,9 @@ impl Decodable for Transaction {
if special_transaction_type == TransactionType::MnhfSignal {
segwit = false;
}
if special_transaction_type == TransactionType::Coinbase {
segwit = false;
}
if segwit {
let segwit_flag = u8::consensus_decode_from_finite_reader(r)?;
match segwit_flag {
Expand Down
Loading