consensus: remove incorrect check

This consensus rule is supposed to apply to transactions whose
transparent inputs are the *outputs* of previous coinbase
transactions, not to transactions with coinbase inputs.  Because that
logic is different enough from this logic, and requires different data
flow, it's cleaner to just remove this check for now.
This commit is contained in:
Henry de Valence 2020-11-19 19:17:27 -08:00 committed by Deirdre Connolly
parent ace1103462
commit 2eceff421f
2 changed files with 0 additions and 23 deletions

View File

@ -131,7 +131,6 @@ where
}
check::has_inputs_and_outputs(&tx)?;
check::any_coinbase_inputs_no_transparent_outputs(&tx)?;
let sighash = tx.sighash(
NetworkUpgrade::Sapling, // TODO: pass this in

View File

@ -74,28 +74,6 @@ pub fn has_inputs_and_outputs(tx: &Transaction) -> Result<(), TransactionError>
}
}
/// Check that a transaction with one or more transparent inputs from coinbase
/// transactions has no transparent outputs.
///
/// Note that inputs from coinbase transactions include Founders Reward
/// outputs.
///
/// https://zips.z.cash/protocol/canopy.pdf#consensusfrombitcoin
pub fn any_coinbase_inputs_no_transparent_outputs(
tx: &Transaction,
) -> Result<(), TransactionError> {
match tx {
Transaction::V4 { outputs, .. } => {
if !tx.contains_coinbase_input() || !outputs.is_empty() {
Ok(())
} else {
Err(TransactionError::NoTransfer)
}
}
_ => Err(TransactionError::WrongVersion),
}
}
/// Check that if there are no Spends or Outputs, that valueBalance is also 0.
///
/// https://zips.z.cash/protocol/canopy.pdf#consensusfrombitcoin