@@ -63,15 +63,7 @@ impl Miner {
63
63
64
64
// Set compute unit price
65
65
final_ixs. push ( ComputeBudgetInstruction :: set_compute_unit_price (
66
- if self . dynamic_fee {
67
- if let Some ( dynamic_fee) = self . dynamic_fee ( ) . await {
68
- dynamic_fee
69
- } else {
70
- self . priority_fee . unwrap_or ( 0 )
71
- }
72
- } else {
73
- self . priority_fee . unwrap_or ( 0 )
74
- }
66
+ self . priority_fee . unwrap_or ( 0 ) ,
75
67
) ) ;
76
68
77
69
// Add in user instructions
@@ -97,21 +89,17 @@ impl Miner {
97
89
if attempts % 10 == 0 {
98
90
// Reset the compute unit price
99
91
if self . dynamic_fee {
100
- if let Some ( dynamic_fee) = self . dynamic_fee ( ) . await {
101
- progress_bar. println ( format ! ( " Priority fee: {} microlamports" , dynamic_fee) ) ;
102
- final_ixs. remove ( 1 ) ;
103
- final_ixs. insert ( 1 , ComputeBudgetInstruction :: set_compute_unit_price ( dynamic_fee) ) ;
92
+ let fee = if let Some ( fee) = self . dynamic_fee ( ) . await {
93
+ progress_bar. println ( format ! ( " Priority fee: {} microlamports" , fee) ) ;
94
+ fee
104
95
} else {
105
- let fallback_fee = self . priority_fee . unwrap_or ( 0 ) ;
106
- progress_bar. println ( format ! (
107
- "{} Dynamic fees not supported by this RPC. Falling back to static value: {} microlamports" ,
108
- "WARNING" . bold( ) . yellow( ) ,
109
- fallback_fee
110
- ) ) ;
111
- final_ixs. remove ( 1 ) ;
112
- final_ixs. insert ( 1 , ComputeBudgetInstruction :: set_compute_unit_price ( fallback_fee) ) ;
113
- }
114
- }
96
+ let fee = self . priority_fee . unwrap_or ( 0 ) ;
97
+ progress_bar. println ( format ! ( " {} Dynamic fees not supported by this RPC. Falling back to static value: {} microlamports" , "WARNING" . bold( ) . yellow( ) , fee) ) ;
98
+ fee
99
+ } ;
100
+ final_ixs. remove ( 1 ) ;
101
+ final_ixs. insert ( 1 , ComputeBudgetInstruction :: set_compute_unit_price ( fee) ) ;
102
+ }
115
103
116
104
// Resign the tx
117
105
let ( hash, _slot) = client
0 commit comments