mirror of
https://github.com/Cuprate/cuprate.git
synced 2025-01-09 04:20:01 +00:00
handle miner txs when calculating fee
This commit is contained in:
parent
6337441711
commit
e0fc620363
1 changed files with 5 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue