@@ -75,7 +75,7 @@ type PrivacyMapTx interface {
7575
7676 // PseudoToReal returns the real value associated with the given pseudo
7777 // value. If no such pair is found, then ErrNoSuchKeyFound is returned.
78- PseudoToReal (pseudo string ) (string , error )
78+ PseudoToReal (ctx context. Context , pseudo string ) (string , error )
7979
8080 // RealToPseudo returns the pseudo value associated with the given real
8181 // value. If no such pair is found, then ErrNoSuchKeyFound is returned.
@@ -228,7 +228,9 @@ func (p *privacyMapTx) NewPair(_ context.Context, real, pseudo string) error {
228228// it does then the real value is returned, else an error is returned.
229229//
230230// NOTE: this is part of the PrivacyMapTx interface.
231- func (p * privacyMapTx ) PseudoToReal (pseudo string ) (string , error ) {
231+ func (p * privacyMapTx ) PseudoToReal (_ context.Context , pseudo string ) (string ,
232+ error ) {
233+
232234 privacyBucket , err := getBucket (p .boltTx , privacyBucketKey )
233235 if err != nil {
234236 return "" , err
@@ -354,12 +356,14 @@ func NewPseudoStr(n int) (string, error) {
354356 return string (b ), nil
355357}
356358
357- func RevealString (tx PrivacyMapTx , pseudo string ) (string , error ) {
359+ func RevealString (ctx context.Context , tx PrivacyMapTx , pseudo string ) (string ,
360+ error ) {
361+
358362 if pseudo == "" {
359363 return pseudo , nil
360364 }
361365
362- return tx .PseudoToReal (pseudo )
366+ return tx .PseudoToReal (ctx , pseudo )
363367}
364368
365369func HideUint64 (ctx context.Context , tx PrivacyMapTx , real uint64 ) (uint64 ,
@@ -382,12 +386,14 @@ func HideUint64(ctx context.Context, tx PrivacyMapTx, real uint64) (uint64,
382386 return pseudoUint64 , nil
383387}
384388
385- func RevealUint64 (tx PrivacyMapTx , pseudo uint64 ) (uint64 , error ) {
389+ func RevealUint64 (ctx context.Context , tx PrivacyMapTx , pseudo uint64 ) (uint64 ,
390+ error ) {
391+
386392 if pseudo == 0 {
387393 return 0 , nil
388394 }
389395
390- real , err := tx .PseudoToReal (Uint64ToStr (pseudo ))
396+ real , err := tx .PseudoToReal (ctx , Uint64ToStr (pseudo ))
391397 if err != nil {
392398 return 0 , err
393399 }
@@ -429,11 +435,11 @@ func NewPseudoChanPoint() (string, error) {
429435 return fmt .Sprintf ("%s:%d" , pseudoTXID , pseudoIndex ), nil
430436}
431437
432- func RevealChanPoint (tx PrivacyMapTx , txid string , index uint32 ) ( string ,
433- uint32 , error ) {
438+ func RevealChanPoint (ctx context. Context , tx PrivacyMapTx , txid string ,
439+ index uint32 ) ( string , uint32 , error ) {
434440
435441 fakePoint := fmt .Sprintf ("%s:%d" , txid , index )
436- real , err := tx .PseudoToReal (fakePoint )
442+ real , err := tx .PseudoToReal (ctx , fakePoint )
437443 if err != nil {
438444 return "" , 0 , err
439445 }
@@ -477,13 +483,15 @@ func HideBytes(ctx context.Context, tx PrivacyMapTx, realBytes []byte) ([]byte,
477483 return hex .DecodeString (pseudo )
478484}
479485
480- func RevealBytes (tx PrivacyMapTx , pseudoBytes []byte ) ([]byte , error ) {
486+ func RevealBytes (ctx context.Context , tx PrivacyMapTx ,
487+ pseudoBytes []byte ) ([]byte , error ) {
488+
481489 if pseudoBytes == nil {
482490 return nil , nil
483491 }
484492
485493 pseudo := hex .EncodeToString (pseudoBytes )
486- pseudo , err := RevealString (tx , pseudo )
494+ pseudo , err := RevealString (ctx , tx , pseudo )
487495 if err != nil {
488496 return nil , err
489497 }
0 commit comments