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:
parent
ace1103462
commit
2eceff421f
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue