main: fetch prune status from db for handleGetBlockChainInfo

This change is part of the effort to add pruning support to btcd.

Now that pruning is allowed in btcd, accurately report the prune status
back to the user.
This commit is contained in:
Calvin Kim 2023-08-22 15:54:08 +09:00
parent 56f3463d9d
commit 47261ef205

View file

@ -1200,7 +1200,7 @@ func handleGetBlockChainInfo(s *rpcServer, cmd interface{}, closeChan <-chan str
BestBlockHash: chainSnapshot.Hash.String(),
Difficulty: getDifficultyRatio(chainSnapshot.Bits, params),
MedianTime: chainSnapshot.MedianTime.Unix(),
Pruned: false,
Pruned: cfg.Prune != 0,
SoftForks: &btcjson.SoftForks{
Bip9SoftForks: make(map[string]*btcjson.Bip9SoftForkDescription),
},