if end == Some(self.height) {
0
} else {
limit
}
} else {
u128::max_value()
} - balance,
end,
symbol,
limit,
timestamp: self.timestamp,
}
.store(),
)?;
let inscription_id = InscriptionId { txid, index: 0 };
if let Some(sequence_number) = self
.inscription_id_to_sequence_number
.get(&inscription_id.store())?
{
self
.sequence_number_to_rune
.insert(sequence_number.value(), rune.0)?;
}
}
}
let mut burned: HashMap<u128, u128> = HashMap::new();
if burn {
for (id, balance) in unallocated {
*burned.entry(id).or_default() += balance;
}
} else {
// Assign all un-allocated runes to the first non OP_RETURN output
if let Some((vout, _)) = tx
.output
.iter()
.enumerate()
.find(|(_, tx_out)| !tx_out.script_pubkey.is_op_return())