Skip to content

Commit 4bff65e

Browse files
committed
Actually autofill the CoinSelectionConfigLoader in get_spendable_coins
1 parent e961a23 commit 4bff65e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

chia/wallet/wallet_rpc_api.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,19 +1808,18 @@ async def get_spendable_coins(self, request: GetSpendableCoins) -> GetSpendableC
18081808
for coin_record in all_coin_records:
18091809
if coin_record.name() in unconfirmed_removal_ids:
18101810
unconfirmed_removals.append(coin_record.to_coin_record(unconfirmed_removal_ids[coin_record.name()]))
1811+
1812+
cs_config = request.autofill(constants=self.service.wallet_state_manager.constants)
18111813
for coin_record in spendable_coins: # remove all the unconfirmed coins, exclude coins and dust.
18121814
if coin_record.name() in unconfirmed_removal_ids:
18131815
continue
1814-
if request.excluded_coin_ids is not None and coin_record.coin.name() in request.excluded_coin_ids:
1816+
if coin_record.coin.name() in cs_config.excluded_coin_ids:
18151817
continue
1816-
if (request.min_coin_amount is not None and coin_record.coin.amount < request.min_coin_amount) or (
1817-
request.max_coin_amount is not None and coin_record.coin.amount > request.max_coin_amount
1818+
if (coin_record.coin.amount < cs_config.min_coin_amount) or (
1819+
coin_record.coin.amount > cs_config.max_coin_amount
18181820
):
18191821
continue
1820-
if (
1821-
request.excluded_coin_amounts is not None
1822-
and coin_record.coin.amount in request.excluded_coin_amounts
1823-
):
1822+
if coin_record.coin.amount in cs_config.excluded_coin_amounts:
18241823
continue
18251824
c_r = await state_mgr.get_coin_record_by_wallet_record(coin_record)
18261825
assert c_r is not None and c_r.coin == coin_record.coin # this should never happen

0 commit comments

Comments
 (0)