handle miner txs when calculating fee
Some checks failed
Audit / audit (push) Has been cancelled
Deny / audit (push) Has been cancelled

This commit is contained in:
Boog900 2024-08-02 00:52:10 +01:00
parent 6337441711
commit e0fc620363
No known key found for this signature in database
GPG key ID: 42AB1287CB0041C2

View file

@ -122,8 +122,11 @@ pub fn tx_fee(tx: &Transaction) -> u64 {
match &tx {
Transaction::V1 { prefix, .. } => {
for input in &prefix.inputs {
if let Input::ToKey { amount, .. } = input {
fee = fee.checked_add(amount.unwrap_or(0)).unwrap();
match input {
Input::Gen(_) => return 0,
Input::ToKey { amount, .. } => {
fee = fee.checked_add(amount.unwrap_or(0)).unwrap();
}
}
}