@@ -181,7 +181,8 @@ async def get_coin_record(self, coin_name: bytes32) -> Optional[CoinRecord]:
181
181
if row is not None :
182
182
coin = self .row_to_coin (row )
183
183
spent_index = uint32 (0 ) if row [1 ] <= 0 else uint32 (row [1 ])
184
- return CoinRecord (coin , row [0 ], spent_index , row [2 ], row [6 ])
184
+ coinbase = False if row [2 ] == 0 else True
185
+ return CoinRecord (coin , row [0 ], spent_index , coinbase , row [6 ])
185
186
return None
186
187
187
188
async def get_coin_records (self , names : Collection [bytes32 ]) -> list [CoinRecord ]:
@@ -207,7 +208,8 @@ async def get_coin_records(self, names: Collection[bytes32]) -> list[CoinRecord]
207
208
for row in await cursor .fetchall ():
208
209
coin = self .row_to_coin (row )
209
210
spent_index = uint32 (0 ) if row [1 ] <= 0 else uint32 (row [1 ])
210
- record = CoinRecord (coin , row [0 ], spent_index , row [2 ], row [6 ])
211
+ coinbase = False if row [2 ] == 0 else True
212
+ record = CoinRecord (coin , row [0 ], spent_index , coinbase , row [6 ])
211
213
coins .append (record )
212
214
213
215
return coins
@@ -241,7 +243,8 @@ async def get_coins_removed_at_height(self, height: uint32) -> list[CoinRecord]:
241
243
for row in await cursor .fetchall ():
242
244
if row [1 ] > 0 :
243
245
coin = self .row_to_coin (row )
244
- coin_record = CoinRecord (coin , row [0 ], row [1 ], row [2 ], row [6 ])
246
+ coinbase = False if row [2 ] == 0 else True
247
+ coin_record = CoinRecord (coin , row [0 ], row [1 ], coinbase , row [6 ])
245
248
coins .append (coin_record )
246
249
return coins
247
250
@@ -266,7 +269,8 @@ async def get_coin_records_by_puzzle_hash(
266
269
for row in await cursor .fetchall ():
267
270
coin = self .row_to_coin (row )
268
271
spent_index = uint32 (0 ) if row [1 ] <= 0 else uint32 (row [1 ])
269
- coins .add (CoinRecord (coin , row [0 ], spent_index , row [2 ], row [6 ]))
272
+ coinbase = False if row [2 ] == 0 else True
273
+ coins .add (CoinRecord (coin , row [0 ], spent_index , coinbase , row [6 ]))
270
274
return list (coins )
271
275
272
276
async def get_coin_records_by_puzzle_hashes (
@@ -295,7 +299,8 @@ async def get_coin_records_by_puzzle_hashes(
295
299
for row in await cursor .fetchall ():
296
300
coin = self .row_to_coin (row )
297
301
spent_index = uint32 (0 ) if row [1 ] <= 0 else uint32 (row [1 ])
298
- coins .add (CoinRecord (coin , row [0 ], spent_index , row [2 ], row [6 ]))
302
+ coinbase = False if row [2 ] == 0 else True
303
+ coins .add (CoinRecord (coin , row [0 ], spent_index , coinbase , row [6 ]))
299
304
return list (coins )
300
305
301
306
async def get_coin_records_by_names (
@@ -322,7 +327,8 @@ async def get_coin_records_by_names(
322
327
for row in await cursor .fetchall ():
323
328
coin = self .row_to_coin (row )
324
329
spent_index = uint32 (0 ) if row [1 ] <= 0 else uint32 (row [1 ])
325
- coins .add (CoinRecord (coin , row [0 ], spent_index , row [2 ], row [6 ]))
330
+ coinbase = False if row [2 ] == 0 else True
331
+ coins .add (CoinRecord (coin , row [0 ], spent_index , coinbase , row [6 ]))
326
332
327
333
return list (coins )
328
334
@@ -393,7 +399,8 @@ async def get_coin_records_by_parent_ids(
393
399
async for row in cursor :
394
400
coin = self .row_to_coin (row )
395
401
spent_index = uint32 (0 ) if row [1 ] <= 0 else uint32 (row [1 ])
396
- coins .add (CoinRecord (coin , row [0 ], spent_index , row [2 ], row [6 ]))
402
+ coinbase = False if row [2 ] == 0 else True
403
+ coins .add (CoinRecord (coin , row [0 ], spent_index , coinbase , row [6 ]))
397
404
398
405
return list (coins )
399
406
@@ -567,7 +574,8 @@ async def rollback_to_block(self, block_index: int) -> dict[bytes32, CoinRecord]
567
574
for row in rows :
568
575
coin = self .row_to_coin (row )
569
576
spent_index = uint32 (0 ) if row [1 ] <= 0 else uint32 (row [1 ])
570
- record = CoinRecord (coin , uint32 (0 ), spent_index , row [2 ], uint64 (0 ))
577
+ coinbase = False if row [2 ] == 0 else True
578
+ record = CoinRecord (coin , uint32 (0 ), spent_index , coinbase , uint64 (0 ))
571
579
coin_name = bytes32 (row [7 ])
572
580
coin_changes [coin_name ] = record
573
581
@@ -582,7 +590,8 @@ async def rollback_to_block(self, block_index: int) -> dict[bytes32, CoinRecord]
582
590
)
583
591
for row in rows :
584
592
coin = self .row_to_coin (row )
585
- record = CoinRecord (coin , row [0 ], uint32 (0 ), row [2 ], row [6 ])
593
+ coinbase = False if row [2 ] == 0 else True
594
+ record = CoinRecord (coin , row [0 ], uint32 (0 ), coinbase , row [6 ])
586
595
coin_name = bytes32 (row [7 ])
587
596
if coin_name not in coin_changes :
588
597
coin_changes [coin_name ] = record
0 commit comments