mirror of
https://github.com/btcsuite/btcd.git
synced 2025-02-21 14:04:20 +01:00
btcjson+rpc: add min activation height to soft fork RPC response
This commit is contained in:
parent
54f6fa948e
commit
0b245cca4f
2 changed files with 13 additions and 11 deletions
|
@ -11,8 +11,8 @@ import (
|
|||
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcd/btcutil"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
)
|
||||
|
||||
// GetBlockHeaderVerboseResult models the data from the getblockheader command when
|
||||
|
@ -172,12 +172,13 @@ type SoftForkDescription struct {
|
|||
// Bip9SoftForkDescription describes the current state of a defined BIP0009
|
||||
// version bits soft-fork.
|
||||
type Bip9SoftForkDescription struct {
|
||||
Status string `json:"status"`
|
||||
Bit uint8 `json:"bit"`
|
||||
StartTime1 int64 `json:"startTime"`
|
||||
StartTime2 int64 `json:"start_time"`
|
||||
Timeout int64 `json:"timeout"`
|
||||
Since int32 `json:"since"`
|
||||
Status string `json:"status"`
|
||||
Bit uint8 `json:"bit"`
|
||||
StartTime1 int64 `json:"startTime"`
|
||||
StartTime2 int64 `json:"start_time"`
|
||||
Timeout int64 `json:"timeout"`
|
||||
Since int32 `json:"since"`
|
||||
MinActivationHeight int32 `json:"min_activation_height"`
|
||||
}
|
||||
|
||||
// StartTime returns the starting time of the softfork as a Unix epoch.
|
||||
|
|
|
@ -1297,10 +1297,11 @@ func handleGetBlockChainInfo(s *rpcServer, cmd interface{}, closeChan <-chan str
|
|||
endTime = ender.EndTime().Unix()
|
||||
}
|
||||
chainInfo.SoftForks.Bip9SoftForks[forkName] = &btcjson.Bip9SoftForkDescription{
|
||||
Status: strings.ToLower(statusString),
|
||||
Bit: deploymentDetails.BitNumber,
|
||||
StartTime2: startTime,
|
||||
Timeout: endTime,
|
||||
Status: strings.ToLower(statusString),
|
||||
Bit: deploymentDetails.BitNumber,
|
||||
StartTime2: startTime,
|
||||
Timeout: endTime,
|
||||
MinActivationHeight: int32(deploymentDetails.MinActivationHeight),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue