remove special case for 0-input 0-output transaction deserialization

This creates two ways to encode an empty transaction; we should use only the
Segwit-enabled one because that's what we do for 0-input non-0-output transactions.
This commit is contained in:
Andrew Poelstra 2018-10-01 20:38:05 +00:00
parent 98e39b4383
commit a181a523c6
1 changed files with 0 additions and 9 deletions

View File

@ -399,15 +399,6 @@ impl<D: Decoder> Decodable<D> for Transaction {
if input.is_empty() { if input.is_empty() {
let segwit_flag: u8 = Decodable::consensus_decode(d)?; let segwit_flag: u8 = Decodable::consensus_decode(d)?;
match segwit_flag { match segwit_flag {
// Empty tx
0 => {
Ok(Transaction {
version: version,
input: input,
output: vec![],
lock_time: Decodable::consensus_decode(d)?,
})
}
// BIP144 input witnesses // BIP144 input witnesses
1 => { 1 => {
let mut input: Vec<TxIn> = Decodable::consensus_decode(d)?; let mut input: Vec<TxIn> = Decodable::consensus_decode(d)?;