(!tx_out.script_pubkey.is_op_return()).then_some(output) }) .collect::>(); if amount == 0 { // if amount is zero, divide balance between eligible outputs let amount = *balance / destinations.len() as u128; for output in destinations { allocate(balance, amount, output); } } else { // if amount is non-zero, distribute amount to eligible outputs for output in destinations { allocate(balance, amount.min(*balance), output); } } } else { // Get the allocatable amount let amount = if amount == 0 { *balance } else { amount.min(*balance) }; allocate(balance, amount, output); } } // increment entries with minted runes for (id, amount) in mintable { let minted = limits[&id] - amount;