@@ -173,7 +173,8 @@ async def get_coin_record(self, coin_name: bytes32) -> Optional[CoinRecord]:
173
173
if row is not None :
174
174
coin = self .row_to_coin (row )
175
175
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 ])
177
178
return None
178
179
179
180
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]
199
200
for row in await cursor .fetchall ():
200
201
coin = self .row_to_coin (row )
201
202
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 ])
203
205
coins .append (record )
204
206
205
207
return coins
@@ -233,7 +235,8 @@ async def get_coins_removed_at_height(self, height: uint32) -> list[CoinRecord]:
233
235
for row in await cursor .fetchall ():
234
236
if row [1 ] > 0 :
235
237
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 ])
237
240
coins .append (coin_record )
238
241
return coins
239
242
@@ -258,7 +261,8 @@ async def get_coin_records_by_puzzle_hash(
258
261
for row in await cursor .fetchall ():
259
262
coin = self .row_to_coin (row )
260
263
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 ]))
262
266
return list (coins )
263
267
264
268
async def get_coin_records_by_puzzle_hashes (
@@ -287,7 +291,8 @@ async def get_coin_records_by_puzzle_hashes(
287
291
for row in await cursor .fetchall ():
288
292
coin = self .row_to_coin (row )
289
293
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 ]))
291
296
return list (coins )
292
297
293
298
async def get_coin_records_by_names (
@@ -314,7 +319,8 @@ async def get_coin_records_by_names(
314
319
for row in await cursor .fetchall ():
315
320
coin = self .row_to_coin (row )
316
321
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 ]))
318
324
319
325
return list (coins )
320
326
@@ -385,7 +391,8 @@ async def get_coin_records_by_parent_ids(
385
391
async for row in cursor :
386
392
coin = self .row_to_coin (row )
387
393
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 ]))
389
396
390
397
return list (coins )
391
398
@@ -559,7 +566,8 @@ async def rollback_to_block(self, block_index: int) -> dict[bytes32, CoinRecord]
559
566
for row in rows :
560
567
coin = self .row_to_coin (row )
561
568
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 ))
563
571
coin_name = bytes32 (row [7 ])
564
572
coin_changes [coin_name ] = record
565
573
@@ -574,7 +582,8 @@ async def rollback_to_block(self, block_index: int) -> dict[bytes32, CoinRecord]
574
582
)
575
583
for row in rows :
576
584
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 ])
578
587
coin_name = bytes32 (row [7 ])
579
588
if coin_name not in coin_changes :
580
589
coin_changes [coin_name ] = record
0 commit comments