btcjson: update the fields of GetBlockChainInfoResult
This commit updates the fields of GetBlockChainInfoResult to reflect the current state of the RPC as widely implemented by other full-node implementations.
This commit is contained in:
parent
c5751b75a9
commit
ec1c93ecc0
1 changed files with 32 additions and 7 deletions
|
@ -75,6 +75,26 @@ type GetAddedNodeInfoResult struct {
|
||||||
Addresses *[]GetAddedNodeInfoResultAddr `json:"addresses,omitempty"`
|
Addresses *[]GetAddedNodeInfoResultAddr `json:"addresses,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SoftForkDescription describes the current state of a soft-fork which was
|
||||||
|
// deployed using a super-majority block signalling.
|
||||||
|
type SoftForkDescription struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Version uint32 `json:"version"`
|
||||||
|
Reject struct {
|
||||||
|
Status bool `json:"status"`
|
||||||
|
} `json:"reject"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bip9SoftForkDescription describes the current state of a defined BIP0009
|
||||||
|
// version bits soft-fork.
|
||||||
|
type Bip9SoftForkDescription struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
Bit uint8 `json:"bit"`
|
||||||
|
StartTime int64 `json:"startTime"`
|
||||||
|
Timeout int64 `json:"timeout"`
|
||||||
|
Since int32 `json:"since"`
|
||||||
|
}
|
||||||
|
|
||||||
// GetBlockChainInfoResult models the data returned from the getblockchaininfo
|
// GetBlockChainInfoResult models the data returned from the getblockchaininfo
|
||||||
// command.
|
// command.
|
||||||
type GetBlockChainInfoResult struct {
|
type GetBlockChainInfoResult struct {
|
||||||
|
@ -83,8 +103,13 @@ type GetBlockChainInfoResult struct {
|
||||||
Headers int32 `json:"headers"`
|
Headers int32 `json:"headers"`
|
||||||
BestBlockHash string `json:"bestblockhash"`
|
BestBlockHash string `json:"bestblockhash"`
|
||||||
Difficulty float64 `json:"difficulty"`
|
Difficulty float64 `json:"difficulty"`
|
||||||
VerificationProgress float64 `json:"verificationprogress"`
|
MedianTime int64 `json:"mediantime"`
|
||||||
ChainWork string `json:"chainwork"`
|
VerificationProgress float64 `json:"verificationprogress,omitempty"`
|
||||||
|
Pruned bool `json:"pruned"`
|
||||||
|
PruneHeight int32 `json:"pruneheight,omitempty"`
|
||||||
|
ChainWork string `json:"chainwork,omitempty"`
|
||||||
|
SoftForks []*SoftForkDescription `json:"softforks"`
|
||||||
|
Bip9SoftForks map[string]*Bip9SoftForkDescription `json:"bip9_softforks"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetBlockTemplateResultTx models the transactions field of the
|
// GetBlockTemplateResultTx models the transactions field of the
|
||||||
|
|
Loading…
Reference in a new issue