btcjson: use correct json tag for Bip9SoftForkDescription.StartTime
This commit is contained in:
parent
266851e329
commit
93a84aa014
2 changed files with 18 additions and 9 deletions
|
@ -92,11 +92,20 @@ type SoftForkDescription struct {
|
||||||
type Bip9SoftForkDescription struct {
|
type Bip9SoftForkDescription struct {
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
Bit uint8 `json:"bit"`
|
Bit uint8 `json:"bit"`
|
||||||
StartTime int64 `json:"startTime"`
|
StartTime1 int64 `json:"startTime"`
|
||||||
|
StartTime2 int64 `json:"start_time"`
|
||||||
Timeout int64 `json:"timeout"`
|
Timeout int64 `json:"timeout"`
|
||||||
Since int32 `json:"since"`
|
Since int32 `json:"since"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StartTime returns the starting time of the softfork as a Unix epoch.
|
||||||
|
func (d *Bip9SoftForkDescription) StartTime() int64 {
|
||||||
|
if d.StartTime1 != 0 {
|
||||||
|
return d.StartTime1
|
||||||
|
}
|
||||||
|
return d.StartTime2
|
||||||
|
}
|
||||||
|
|
||||||
// SoftForks describes the current softforks enabled by the backend. Softforks
|
// SoftForks describes the current softforks enabled by the backend. Softforks
|
||||||
// activated through BIP9 are grouped together separate from any other softforks
|
// activated through BIP9 are grouped together separate from any other softforks
|
||||||
// with different activation types.
|
// with different activation types.
|
||||||
|
|
|
@ -1286,7 +1286,7 @@ func handleGetBlockChainInfo(s *rpcServer, cmd interface{}, closeChan <-chan str
|
||||||
chainInfo.SoftForks.Bip9SoftForks[forkName] = &btcjson.Bip9SoftForkDescription{
|
chainInfo.SoftForks.Bip9SoftForks[forkName] = &btcjson.Bip9SoftForkDescription{
|
||||||
Status: strings.ToLower(statusString),
|
Status: strings.ToLower(statusString),
|
||||||
Bit: deploymentDetails.BitNumber,
|
Bit: deploymentDetails.BitNumber,
|
||||||
StartTime: int64(deploymentDetails.StartTime),
|
StartTime2: int64(deploymentDetails.StartTime),
|
||||||
Timeout: int64(deploymentDetails.ExpireTime),
|
Timeout: int64(deploymentDetails.ExpireTime),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue