mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-20 08:05:33 +03:00
checkpoint: into main from release/2.0.0 @ 0101ae11b4
(#16033)
Source hash: 0101ae11b4
Remaining commits: 10
This commit is contained in:
commit
95099f91eb
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user