checkpoint: into main from release/2.0.0 @ 0101ae11b4 (#16033)

Source hash: 0101ae11b4
Remaining commits: 10
This commit is contained in:
William Allen 2023-08-14 14:18:44 -05:00 committed by GitHub
commit 95099f91eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -12,6 +12,7 @@ from secrets import token_bytes
from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple
from blspy import AugSchemeMPL, G1Element, G2Element
from chia_rs import ALLOW_BACKREFS
from chiabip158 import PyBIP158
from chia.consensus.block_creation import create_unfinished_block
@ -1322,8 +1323,12 @@ class FullNodeAPI:
block_generator: Optional[BlockGenerator] = await self.full_node.blockchain.get_block_generator(block)
assert block_generator is not None
try:
flags = 0
if height >= self.full_node.constants.HARD_FORK_HEIGHT:
flags = ALLOW_BACKREFS
spend_info = await asyncio.get_running_loop().run_in_executor(
self.executor, get_puzzle_and_solution_for_coin, block_generator, coin_record.coin, 0
self.executor, get_puzzle_and_solution_for_coin, block_generator, coin_record.coin, flags
)
except ValueError:
return reject_msg

View File

@ -3,6 +3,8 @@ from __future__ import annotations
from datetime import datetime, timezone
from typing import Any, Dict, List, Optional
from chia_rs import ALLOW_BACKREFS
from chia.consensus.block_record import BlockRecord
from chia.consensus.blockchain import Blockchain, BlockchainMutexPriority
from chia.consensus.cost_calculator import NPCResult
@ -741,7 +743,11 @@ class FullNodeRpcApi:
block_generator: Optional[BlockGenerator] = await self.service.blockchain.get_block_generator(block)
assert block_generator is not None
spend_info = get_puzzle_and_solution_for_coin(block_generator, coin_record.coin, 0)
flags = 0
if height >= self.service.constants.HARD_FORK_HEIGHT:
flags = ALLOW_BACKREFS
spend_info = get_puzzle_and_solution_for_coin(block_generator, coin_record.coin, flags)
return {"coin_solution": CoinSpend(coin_record.coin, spend_info.puzzle, spend_info.solution)}
async def get_additions_and_removals(self, request: Dict[str, Any]) -> EndpointResult: