mirror of
https://github.com/Cuprate/cuprate.git
synced 2025-01-24 11:36:10 +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 {
|
match &tx {
|
||||||
Transaction::V1 { prefix, .. } => {
|
Transaction::V1 { prefix, .. } => {
|
||||||
for input in &prefix.inputs {
|
for input in &prefix.inputs {
|
||||||
if let Input::ToKey { amount, .. } = input {
|
match input {
|
||||||
fee = fee.checked_add(amount.unwrap_or(0)).unwrap();
|
Input::Gen(_) => return 0,
|
||||||
|
Input::ToKey { amount, .. } => {
|
||||||
|
fee = fee.checked_add(amount.unwrap_or(0)).unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue