@@ -418,7 +418,7 @@ export class WalletDB {
418
418
async removeAccount ( account : Account , tx ?: IDatabaseTransaction ) : Promise < void > {
419
419
await this . db . withTransaction ( tx , async ( tx ) => {
420
420
await this . accounts . del ( account . id , tx )
421
- await this . clearBalance ( account , tx )
421
+ await this . balances . clear ( tx , account . prefixRange )
422
422
await this . accountIdsToCleanup . put ( account . id , null , tx )
423
423
} )
424
424
}
@@ -542,19 +542,6 @@ export class WalletDB {
542
542
await this . transactions . del ( [ account . prefix , transactionHash ] , tx )
543
543
}
544
544
545
- async clearTransactions ( account : Account , tx ?: IDatabaseTransaction ) : Promise < void > {
546
- await this . transactions . clear ( tx , account . prefixRange )
547
- await this . timestampToTransactionHash . clear ( tx , account . prefixRange )
548
- }
549
-
550
- async clearSequenceToNoteHash ( account : Account , tx ?: IDatabaseTransaction ) : Promise < void > {
551
- await this . sequenceToNoteHash . clear ( tx , account . prefixRange )
552
- }
553
-
554
- async clearNonChainNoteHashes ( account : Account , tx ?: IDatabaseTransaction ) : Promise < void > {
555
- await this . nonChainNoteHashes . clear ( tx , account . prefixRange )
556
- }
557
-
558
545
async * getTransactionHashesBySequence (
559
546
account : Account ,
560
547
tx ?: IDatabaseTransaction ,
@@ -658,20 +645,6 @@ export class WalletDB {
658
645
} )
659
646
}
660
647
661
- /*
662
- * clears sequenceToNoteHash entries for all accounts for a given sequence
663
- */
664
- async clearSequenceNoteHashes ( sequence : number , tx ?: IDatabaseTransaction ) : Promise < void > {
665
- const encoding = this . sequenceToNoteHash . keyEncoding
666
-
667
- const keyRange = StorageUtils . getPrefixesKeyRange (
668
- encoding . serialize ( [ Buffer . alloc ( 4 , 0 ) , [ sequence , Buffer . alloc ( 0 ) ] ] ) ,
669
- encoding . serialize ( [ Buffer . alloc ( 4 , 255 ) , [ sequence , Buffer . alloc ( 0 ) ] ] ) ,
670
- )
671
-
672
- await this . sequenceToNoteHash . clear ( tx , keyRange )
673
- }
674
-
675
648
async addUnspentNoteHash (
676
649
account : Account ,
677
650
noteHash : Buffer ,
@@ -1027,10 +1000,6 @@ export class WalletDB {
1027
1000
await this . decryptedNotes . del ( [ account . prefix , noteHash ] , tx )
1028
1001
}
1029
1002
1030
- async clearDecryptedNotes ( account : Account , tx ?: IDatabaseTransaction ) : Promise < void > {
1031
- await this . decryptedNotes . clear ( tx , account . prefixRange )
1032
- }
1033
-
1034
1003
async * loadDecryptedNotes (
1035
1004
account : Account ,
1036
1005
range ?: DatabaseKeyRange ,
@@ -1088,10 +1057,6 @@ export class WalletDB {
1088
1057
await this . balances . put ( [ account . prefix , assetId ] , balance , tx )
1089
1058
}
1090
1059
1091
- async clearBalance ( account : Account , tx ?: IDatabaseTransaction ) : Promise < void > {
1092
- await this . balances . clear ( tx , account . prefixRange )
1093
- }
1094
-
1095
1060
async * loadExpiredTransactionHashes (
1096
1061
account : Account ,
1097
1062
headSequence : number ,
@@ -1221,13 +1186,6 @@ export class WalletDB {
1221
1186
await this . pendingTransactionHashes . del ( [ account . prefix , [ expiration , transactionHash ] ] , tx )
1222
1187
}
1223
1188
1224
- async clearPendingTransactionHashes (
1225
- account : Account ,
1226
- tx ?: IDatabaseTransaction ,
1227
- ) : Promise < void > {
1228
- await this . pendingTransactionHashes . clear ( tx , account . prefixRange )
1229
- }
1230
-
1231
1189
async forceCleanupDeletedAccounts ( signal ?: AbortSignal ) : Promise < void > {
1232
1190
return this . cleanupDeletedAccounts ( Number . POSITIVE_INFINITY , signal )
1233
1191
}
0 commit comments