mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-01 17:55:20 +00:00
Remove need for coin chooser to take a wallet
This commit is contained in:
parent
a6ea9a0c71
commit
8785b65a1f
2 changed files with 4 additions and 4 deletions
|
@ -24,8 +24,6 @@ from transaction import Transaction
|
||||||
|
|
||||||
|
|
||||||
class CoinChooser(PrintError):
|
class CoinChooser(PrintError):
|
||||||
def __init__(self, wallet):
|
|
||||||
self.wallet = wallet
|
|
||||||
|
|
||||||
def make_tx(self, coins, outputs, change_addrs, fee_estimator,
|
def make_tx(self, coins, outputs, change_addrs, fee_estimator,
|
||||||
dust_threshold):
|
dust_threshold):
|
||||||
|
@ -42,7 +40,6 @@ class CoinChooser(PrintError):
|
||||||
for item in coins:
|
for item in coins:
|
||||||
v = item.get('value')
|
v = item.get('value')
|
||||||
total += v
|
total += v
|
||||||
self.wallet.add_input_info(item)
|
|
||||||
tx.add_input(item)
|
tx.add_input(item)
|
||||||
# no need to estimate fee until we have reached desired amount
|
# no need to estimate fee until we have reached desired amount
|
||||||
if total < amount + fee:
|
if total < amount + fee:
|
||||||
|
|
|
@ -153,7 +153,7 @@ class Abstract_Wallet(PrintError):
|
||||||
self.network = None
|
self.network = None
|
||||||
self.electrum_version = ELECTRUM_VERSION
|
self.electrum_version = ELECTRUM_VERSION
|
||||||
self.gap_limit_for_change = 6 # constant
|
self.gap_limit_for_change = 6 # constant
|
||||||
self.coin_chooser = CoinChooser(self)
|
self.coin_chooser = CoinChooser()
|
||||||
# saved fields
|
# saved fields
|
||||||
self.seed_version = storage.get('seed_version', NEW_SEED_VERSION)
|
self.seed_version = storage.get('seed_version', NEW_SEED_VERSION)
|
||||||
self.use_change = storage.get('use_change',True)
|
self.use_change = storage.get('use_change',True)
|
||||||
|
@ -905,6 +905,9 @@ class Abstract_Wallet(PrintError):
|
||||||
if type == 'address':
|
if type == 'address':
|
||||||
assert is_address(data), "Address " + data + " is invalid!"
|
assert is_address(data), "Address " + data + " is invalid!"
|
||||||
|
|
||||||
|
for item in coins:
|
||||||
|
self.add_input_info(item)
|
||||||
|
|
||||||
# change address
|
# change address
|
||||||
if change_addr:
|
if change_addr:
|
||||||
change_addrs = [change_addr]
|
change_addrs = [change_addr]
|
||||||
|
|
Loading…
Add table
Reference in a new issue