Skip to content

Commit

Permalink
Do not get reward coins value for absorb
Browse files Browse the repository at this point in the history
  • Loading branch information
william-gr committed Jan 10, 2024
1 parent fe8e078 commit 51d8e46
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions pool/absorb_spend.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from chia.consensus.block_rewards import calculate_pool_reward
from chia.consensus.constants import ConsensusConstants
from chia.consensus.default_constants import DEFAULT_CONSTANTS
from chia.types.announcement import Announcement
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.program import Program
Expand All @@ -21,7 +22,7 @@
calculate_synthetic_secret_key,
puzzle_for_pk,
)
from chia.wallet.util.tx_config import DEFAULT_TX_CONFIG
from chia.wallet.util.tx_config import DEFAULT_TX_CONFIG, CoinSelectionConfig, TXConfig
from chia.wallet.wallet import Wallet
from chia.wallet.wallet_info import WalletInfo

Expand All @@ -30,6 +31,16 @@
logger = logging.getLogger('absorb_spend')


COIN_SELECTION_CONFIG = CoinSelectionConfig(uint64(0), uint64(DEFAULT_CONSTANTS.MAX_COIN_AMOUNT), [uint64(0), uint64(1750000000000)], [])
ABSORB_TX_CONFIG = TXConfig(
COIN_SELECTION_CONFIG.min_coin_amount,
COIN_SELECTION_CONFIG.max_coin_amount,
COIN_SELECTION_CONFIG.excluded_coin_amounts,
COIN_SELECTION_CONFIG.excluded_coin_ids,
False,
)


class NoCoinForFee(Exception):
pass

Expand Down Expand Up @@ -66,7 +77,7 @@ async def spend_with_fee(
# FIXME: Find out how many coins can be transferred in one transaction.
# For now limit to 5 XCH.
'amount': min(balance['spendable_balance'], 500000000000),
}], tx_config=DEFAULT_TX_CONFIG)
}], tx_config=ABSORB_TX_CONFIG)

# Find a coin that is big enough for the fee and also not a reward
for coin in transaction.spend_bundle.removals():
Expand Down

0 comments on commit 51d8e46

Please sign in to comment.