Skip to content

Commit

Permalink
cfg: support --clmtonly flag
Browse files Browse the repository at this point in the history
This is used to test and benchmark the claimtrie rebuilding from a
previous downloaded and validated blocks.
  • Loading branch information
roylee17 committed Jul 26, 2021
1 parent 3f80988 commit 073f174
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions btcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ func btcdMain(serverChan chan<- *server) error {
cfg.Listeners, err)
return err
}
if cfg.ClaimTrieOnly {
clmtLog.Infof("ClaimTrie has caught up the best height.")
return nil
}
defer func() {
btcdLog.Infof("Gracefully shutting down the server...")
server.Stop()
Expand Down
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ type config struct {
BlocksOnly bool `long:"blocksonly" description:"Do not accept transactions from remote peers."`
ConfigFile string `short:"C" long:"configfile" description:"Path to configuration file"`
ClaimTrieImpl string `long:"clmtimpl" description:"Implementation of ClaimTrie"`
ClaimTrieOnly bool `long:"clmtonly" description:"Rebuild ClaimTrie from the database on start up and then exits."`
ClaimTrieRecord bool `long:"clmtrecord" description:"Record claim operations made to ClaimTrie"`
ClaimTrieHeight uint32 `long:"clmtheight" description:"Reset height of ClaimTrie"`
ConnectPeers []string `long:"connect" description:"Connect only to the specified peers at startup"`
Expand Down
1 change: 1 addition & 0 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Application Options:
--blocksonly Do not accept transactions from remote peers.
-C, --configfile= Path to configuration file
--clmtimpl= Implementation of ClaimTrie
--clmtonly= Rebuild ClaimTrie from the database on start up and then exits.
--clmtrecord= Record claim operations
--clmtheight= Reset height of ClaimTrie
--connect= Connect only to the specified peers at startup
Expand Down

0 comments on commit 073f174

Please sign in to comment.