Handle zero transaction expirations (#2782)
* handle zero transaction expirations * add consensus rule doc Co-authored-by: teor <teor@riseup.net> Co-authored-by: teor <teor@riseup.net>
This commit is contained in:
parent
b714b2b3b6
commit
825da448c0
|
@ -296,9 +296,15 @@ impl Transaction {
|
||||||
match self {
|
match self {
|
||||||
Transaction::V1 { .. } => None,
|
Transaction::V1 { .. } => None,
|
||||||
Transaction::V2 { .. } => None,
|
Transaction::V2 { .. } => None,
|
||||||
Transaction::V3 { expiry_height, .. } => Some(*expiry_height),
|
Transaction::V3 { expiry_height, .. }
|
||||||
Transaction::V4 { expiry_height, .. } => Some(*expiry_height),
|
| Transaction::V4 { expiry_height, .. }
|
||||||
Transaction::V5 { expiry_height, .. } => Some(*expiry_height),
|
| Transaction::V5 { expiry_height, .. } => match expiry_height {
|
||||||
|
// Consensus rule:
|
||||||
|
// > No limit: To set no limit on transactions (so that they do not expire), nExpiryHeight should be set to 0.
|
||||||
|
// https://zips.z.cash/zip-0203#specification
|
||||||
|
block::Height(0) => None,
|
||||||
|
block::Height(expiry_height) => Some(block::Height(*expiry_height)),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -391,7 +391,7 @@ fn founders_reward_validation_failure() -> Result<(), Report> {
|
||||||
inputs: transaction.inputs().to_vec(),
|
inputs: transaction.inputs().to_vec(),
|
||||||
outputs: vec![transaction.outputs()[0].clone()],
|
outputs: vec![transaction.outputs()[0].clone()],
|
||||||
lock_time: transaction.lock_time(),
|
lock_time: transaction.lock_time(),
|
||||||
expiry_height: transaction.expiry_height().unwrap(),
|
expiry_height: Height(0),
|
||||||
joinsplit_data: None,
|
joinsplit_data: None,
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
Loading…
Reference in New Issue