From 6c287425efe13a0f13434c8abcadcde2c583ec1e Mon Sep 17 00:00:00 2001 From: Jeffrey Picard Date: Thu, 17 Nov 2022 22:18:16 +0000 Subject: [PATCH] remove commented code --- db/db.go | 1 - db/db_get.go | 38 -------------------------------------- main.go | 22 ---------------------- 3 files changed, 61 deletions(-) diff --git a/db/db.go b/db/db.go index 3630eac..451415c 100644 --- a/db/db.go +++ b/db/db.go @@ -670,7 +670,6 @@ func (db *ReadOnlyDBColumnFamily) Unwind() { // Shutdown shuts down the db. func (db *ReadOnlyDBColumnFamily) Shutdown() { - // db.Grp.StopAndWait() log.Println("Calling cleanup...") db.Cleanup() log.Println("Leaving Shutdown...") diff --git a/db/db_get.go b/db/db_get.go index f11c953..4fcb8c2 100644 --- a/db/db_get.go +++ b/db/db_get.go @@ -971,44 +971,6 @@ func (db *ReadOnlyDBColumnFamily) GetTxMerkle(tx_hashes []chainhash.Hash) ([]TxM } func (db *ReadOnlyDBColumnFamily) GetClaimByID(claimID string) ([]*ExpandedResolveResult, []*ExpandedResolveResult, error) { - // claim, err := db.GetCachedClaimTxo(claimID, true) - // if err != nil { - // return nil, err - // } - - // activation, err := db.GetActivation(claim.TxNum, claim.Position) - // if err != nil { - // return nil, err - // } - - // return PrepareResolveResult( - // db, - // claim.TxNum, - // claim.Position, - // claimID, - // claim.Name, - // claim.RootTxNum, - // claim.RootPosition, - // activation, - // claim.ChannelSignatureIsValid, - // ) - - /* - def _getclaimbyid(self, claim_id: str): - rows = [] - extra = [] - claim_hash = bytes.fromhex(claim_id) - stream = self.db._fs_get_claim_by_hash(claim_hash) - rows.append(stream or LookupError(f"Could not find claim at {claim_id}")) - if stream and stream.channel_hash: - channel = self.db._fs_get_claim_by_hash(stream.channel_hash) - extra.append(channel or LookupError(f"Could not find channel at {stream.channel_hash.hex()}")) - if stream and stream.reposted_claim_hash: - repost = self.db._fs_get_claim_by_hash(stream.reposted_claim_hash) - if repost: - extra.append(repost) - return Outputs.to_base64(rows, extra, 0, None, None) - */ rows := make([]*ExpandedResolveResult, 0) extras := make([]*ExpandedResolveResult, 0) claimHash, err := hex.DecodeString(claimID) diff --git a/main.go b/main.go index 01138be..217e1cc 100644 --- a/main.go +++ b/main.go @@ -29,36 +29,14 @@ func main() { if args.CmdType == server.ServeCmd { // This will cancel goroutines with the server finishes. - // ctxWCancel, cancel := context.WithCancel(ctx) - // defer cancel() stopGroup := stop.New() - // defer stopGroup.Stop() initsignals() interrupt := interruptListener() - // s := server.MakeHubServer(ctxWCancel, args) s := server.MakeHubServer(stopGroup, args) go s.Run() - // defer func() { - // log.Println("Shutting down server...") - - // if s.EsClient != nil { - // log.Println("Stopping es client...") - // s.EsClient.Stop() - // } - // if s.GrpcServer != nil { - // log.Println("Stopping grpc server...") - // s.GrpcServer.GracefulStop() - // } - // if s.DB != nil { - // log.Println("Stopping database connection...") - // s.DB.Shutdown() - // } - - // log.Println("Returning from main...") - // }() defer s.Stop() <-interrupt