chain: Add a comment about transaction sizes

We don't need to check transaction sizes yet, because we aren't
parsing or generating transactions outside of blocks.

Part of #483.
This commit is contained in:
teor 2020-06-16 21:54:41 +10:00
parent 67718898c5
commit 719aa75581
1 changed files with 11 additions and 0 deletions

View File

@ -359,6 +359,17 @@ impl ZcashDeserialize for Output {
impl ZcashSerialize for Transaction {
fn zcash_serialize<W: io::Write>(&self, mut writer: W) -> Result<(), io::Error> {
// Post-Sapling, transaction size is limited to MAX_BLOCK_BYTES.
// (Strictly, the maximum transaction size is about 1.5 kB less,
// because blocks also include a block header.)
//
// Currently, all transaction structs are parsed as part of a
// block. So we don't need to check transaction size here, until
// we start parsing mempool transactions, or generating our own
// transactions (see #483).
//
// Since we checkpoint on Sapling activation, we won't ever need
// to check the smaller pre-Sapling transaction size limit.
match self {
Transaction::V1 {
inputs,