Skip to content

Commit

Permalink
Add conditional on aborted
Browse files Browse the repository at this point in the history
  • Loading branch information
howardwu committed Feb 11, 2024
1 parent ca2efa9 commit 0987894
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ledger/block/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ impl<N: Network> Block<N> {
}

// Ensure the block contains transactions.
ensure!(!transactions.is_empty(), "Cannot create a block with zero transactions");
ensure!(
!transactions.is_empty() || !aborted_transaction_ids.is_empty(),
"Cannot create a block with zero transactions"
);

// Ensure the number of transactions is within the allowed range.
if transactions.len() > Transactions::<N>::MAX_TRANSACTIONS {
Expand Down

0 comments on commit 0987894

Please sign in to comment.