@@ -589,22 +589,6 @@ export class WalletDB {
589
589
)
590
590
}
591
591
592
- async setNoteHashSequence (
593
- account : Account ,
594
- noteHash : Buffer ,
595
- sequence : number | null ,
596
- tx ?: IDatabaseTransaction ,
597
- ) : Promise < void > {
598
- await this . db . withTransaction ( tx , async ( tx ) => {
599
- if ( sequence ) {
600
- await this . sequenceToNoteHash . put ( [ account . prefix , [ sequence , noteHash ] ] , null , tx )
601
- await this . nonChainNoteHashes . del ( [ account . prefix , noteHash ] , tx )
602
- } else {
603
- await this . nonChainNoteHashes . put ( [ account . prefix , noteHash ] , null , tx )
604
- }
605
- } )
606
- }
607
-
608
592
async disconnectNoteHashSequence (
609
593
account : Account ,
610
594
noteHash : Buffer ,
@@ -840,7 +824,12 @@ export class WalletDB {
840
824
await this . saveNullifierNoteHash ( account , note . nullifier , noteHash , tx )
841
825
}
842
826
843
- await this . setNoteHashSequence ( account , noteHash , note . sequence , tx )
827
+ if ( note . sequence ) {
828
+ await this . sequenceToNoteHash . put ( [ account . prefix , [ note . sequence , noteHash ] ] , null , tx )
829
+ await this . nonChainNoteHashes . del ( [ account . prefix , noteHash ] , tx )
830
+ } else {
831
+ await this . nonChainNoteHashes . put ( [ account . prefix , noteHash ] , null , tx )
832
+ }
844
833
845
834
await this . decryptedNotes . put ( [ account . prefix , noteHash ] , note , tx )
846
835
} )
0 commit comments