add NotEnoughFunds exception
This commit is contained in:
@@ -4,6 +4,7 @@ import shutil
|
||||
from datetime import datetime
|
||||
is_verbose = False
|
||||
|
||||
class NotEnoughFunds(Exception): pass
|
||||
|
||||
class MyEncoder(json.JSONEncoder):
|
||||
def default(self, obj):
|
||||
|
||||
@@ -27,7 +27,7 @@ import math
|
||||
import json
|
||||
import copy
|
||||
|
||||
from util import print_msg, print_error
|
||||
from util import print_msg, print_error, NotEnoughFunds
|
||||
|
||||
from bitcoin import *
|
||||
from account import *
|
||||
@@ -712,8 +712,9 @@ class Abstract_Wallet(object):
|
||||
fee = fixed_fee if fixed_fee is not None else self.estimated_fee(tx)
|
||||
if total >= amount + fee: break
|
||||
else:
|
||||
print_error("Not enough funds", total, amount, fee)
|
||||
return None
|
||||
raise NotEnoughFunds()
|
||||
#print_error("Not enough funds", total, amount, fee)
|
||||
#return None
|
||||
|
||||
# change address
|
||||
if not change_addr:
|
||||
|
||||
Reference in New Issue
Block a user