examples: exit if balance < SEND_AMOUNT
This commit is contained in:
		
							parent
							
								
									47faa881fb
								
							
						
					
					
						commit
						0aaf420f6d
					
				| @ -77,8 +77,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { | |||||||
|     let balance = wallet.get_balance(); |     let balance = wallet.get_balance(); | ||||||
|     println!("Wallet balance after syncing: {} sats", balance.total()); |     println!("Wallet balance after syncing: {} sats", balance.total()); | ||||||
| 
 | 
 | ||||||
|     if balance.total() == 0 { |     if balance.total() < SEND_AMOUNT { | ||||||
|         println!("Please send some coins to the receiving address"); |         println!( | ||||||
|  |             "Please send at least {} sats to the receiving address", | ||||||
|  |             SEND_AMOUNT | ||||||
|  |         ); | ||||||
|         std::process::exit(0); |         std::process::exit(0); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -69,8 +69,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { | |||||||
|     let balance = wallet.get_balance(); |     let balance = wallet.get_balance(); | ||||||
|     println!("Wallet balance after syncing: {} sats", balance.total()); |     println!("Wallet balance after syncing: {} sats", balance.total()); | ||||||
| 
 | 
 | ||||||
|     if balance.total() == 0 { |     if balance.total() < SEND_AMOUNT { | ||||||
|         println!("Please send some coins to the receiving address"); |         println!( | ||||||
|  |             "Please send at least {} sats to the receiving address", | ||||||
|  |             SEND_AMOUNT | ||||||
|  |         ); | ||||||
|         std::process::exit(0); |         std::process::exit(0); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user