@@ -173,7 +173,8 @@ async def get_coin_record(self, coin_name: bytes32) -> Optional[CoinRecord]:
173173 if row is not None :
174174 coin = self .row_to_coin (row )
175175 spent_index = uint32 (0 ) if row [1 ] <= 0 else uint32 (row [1 ])
176- return CoinRecord (coin , row [0 ], spent_index , row [2 ], row [6 ])
176+ coinbase = False if row [2 ] == 0 else True
177+ return CoinRecord (coin , row [0 ], spent_index , coinbase , row [6 ])
177178 return None
178179
179180 async def get_coin_records (self , names : Collection [bytes32 ]) -> list [CoinRecord ]:
@@ -199,7 +200,8 @@ async def get_coin_records(self, names: Collection[bytes32]) -> list[CoinRecord]
199200 for row in await cursor .fetchall ():
200201 coin = self .row_to_coin (row )
201202 spent_index = uint32 (0 ) if row [1 ] <= 0 else uint32 (row [1 ])
202- record = CoinRecord (coin , row [0 ], spent_index , row [2 ], row [6 ])
203+ coinbase = False if row [2 ] == 0 else True
204+ record = CoinRecord (coin , row [0 ], spent_index , coinbase , row [6 ])
203205 coins .append (record )
204206
205207 return coins
@@ -233,7 +235,8 @@ async def get_coins_removed_at_height(self, height: uint32) -> list[CoinRecord]:
233235 for row in await cursor .fetchall ():
234236 if row [1 ] > 0 :
235237 coin = self .row_to_coin (row )
236- coin_record = CoinRecord (coin , row [0 ], row [1 ], row [2 ], row [6 ])
238+ coinbase = False if row [2 ] == 0 else True
239+ coin_record = CoinRecord (coin , row [0 ], row [1 ], coinbase , row [6 ])
237240 coins .append (coin_record )
238241 return coins
239242
@@ -258,7 +261,8 @@ async def get_coin_records_by_puzzle_hash(
258261 for row in await cursor .fetchall ():
259262 coin = self .row_to_coin (row )
260263 spent_index = uint32 (0 ) if row [1 ] <= 0 else uint32 (row [1 ])
261- coins .add (CoinRecord (coin , row [0 ], spent_index , row [2 ], row [6 ]))
264+ coinbase = False if row [2 ] == 0 else True
265+ coins .add (CoinRecord (coin , row [0 ], spent_index , coinbase , row [6 ]))
262266 return list (coins )
263267
264268 async def get_coin_records_by_puzzle_hashes (
@@ -287,7 +291,8 @@ async def get_coin_records_by_puzzle_hashes(
287291 for row in await cursor .fetchall ():
288292 coin = self .row_to_coin (row )
289293 spent_index = uint32 (0 ) if row [1 ] <= 0 else uint32 (row [1 ])
290- coins .add (CoinRecord (coin , row [0 ], spent_index , row [2 ], row [6 ]))
294+ coinbase = False if row [2 ] == 0 else True
295+ coins .add (CoinRecord (coin , row [0 ], spent_index , coinbase , row [6 ]))
291296 return list (coins )
292297
293298 async def get_coin_records_by_names (
@@ -314,7 +319,8 @@ async def get_coin_records_by_names(
314319 for row in await cursor .fetchall ():
315320 coin = self .row_to_coin (row )
316321 spent_index = uint32 (0 ) if row [1 ] <= 0 else uint32 (row [1 ])
317- coins .add (CoinRecord (coin , row [0 ], spent_index , row [2 ], row [6 ]))
322+ coinbase = False if row [2 ] == 0 else True
323+ coins .add (CoinRecord (coin , row [0 ], spent_index , coinbase , row [6 ]))
318324
319325 return list (coins )
320326
@@ -385,7 +391,8 @@ async def get_coin_records_by_parent_ids(
385391 async for row in cursor :
386392 coin = self .row_to_coin (row )
387393 spent_index = uint32 (0 ) if row [1 ] <= 0 else uint32 (row [1 ])
388- coins .add (CoinRecord (coin , row [0 ], spent_index , row [2 ], row [6 ]))
394+ coinbase = False if row [2 ] == 0 else True
395+ coins .add (CoinRecord (coin , row [0 ], spent_index , coinbase , row [6 ]))
389396
390397 return list (coins )
391398
@@ -559,7 +566,8 @@ async def rollback_to_block(self, block_index: int) -> dict[bytes32, CoinRecord]
559566 for row in rows :
560567 coin = self .row_to_coin (row )
561568 spent_index = uint32 (0 ) if row [1 ] <= 0 else uint32 (row [1 ])
562- record = CoinRecord (coin , uint32 (0 ), spent_index , row [2 ], uint64 (0 ))
569+ coinbase = False if row [2 ] == 0 else True
570+ record = CoinRecord (coin , uint32 (0 ), spent_index , coinbase , uint64 (0 ))
563571 coin_name = bytes32 (row [7 ])
564572 coin_changes [coin_name ] = record
565573
@@ -574,7 +582,8 @@ async def rollback_to_block(self, block_index: int) -> dict[bytes32, CoinRecord]
574582 )
575583 for row in rows :
576584 coin = self .row_to_coin (row )
577- record = CoinRecord (coin , row [0 ], uint32 (0 ), row [2 ], row [6 ])
585+ coinbase = False if row [2 ] == 0 else True
586+ record = CoinRecord (coin , row [0 ], uint32 (0 ), coinbase , row [6 ])
578587 coin_name = bytes32 (row [7 ])
579588 if coin_name not in coin_changes :
580589 coin_changes [coin_name ] = record
0 commit comments