Skip to content

Commit

Permalink
rpcclient: update rescanblockchain support
Browse files Browse the repository at this point in the history
  • Loading branch information
roylee17 committed Oct 31, 2022
1 parent f513fca commit 662d804
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions btcjson/walletsvrcmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -977,16 +977,16 @@ func NewImportMultiCmd(requests []ImportMultiRequest, options *ImportMultiOption

// RescanBlockchainCmd defines the RescanBlockchain JSON-RPC command.
type RescanBlockchainCmd struct {
StartHeight *int64 `jsonrpcdefault:"0"`
StopHeight *int64 `jsonrpcdefault:"0"`
StartHeight *int32 `jsonrpcdefault:"0"`
StopHeight *int32
}

// NewRescanBlockchainCmd returns a new instance which can be used to issue
// an RescanBlockchain JSON-RPC command.
//
// The parameters which are pointers indicate they are optional. Passing nil
// for optional parameters will use the default value.
func NewRescanBlockchainCmd(startHeight *int64, stopHeight *int64) *RescanBlockchainCmd {
func NewRescanBlockchainCmd(startHeight *int32, stopHeight *int32) *RescanBlockchainCmd {
return &RescanBlockchainCmd{
StartHeight: startHeight,
StopHeight: stopHeight,
Expand Down
4 changes: 2 additions & 2 deletions btcjson/walletsvrresults.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ type ListUnspentResult struct {

// RescanBlockchainResult models the data returned from the rescanblockchain command.
type RescanBlockchainResult struct {
StartHeight int64 `json:"start_height"`
StoptHeight int64 `json:"stop_height"`
StartHeight int32 `json:"start_height"`
StoptHeight int32 `json:"stop_height"`
}

// SignRawTransactionError models the data that contains script verification
Expand Down
4 changes: 2 additions & 2 deletions rpcclient/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -2062,14 +2062,14 @@ func (r FutureRescanBlockchainResult) Receive() (*btcjson.RescanBlockchainResult
// returned instance.
//
// See RescanBlockchain for the blocking version and more details.
func (c *Client) RescanBlockchainAsync(startHeight *int64, stopHeight *int64) FutureRescanBlockchainResult {
func (c *Client) RescanBlockchainAsync(startHeight *int32, stopHeight *int32) FutureRescanBlockchainResult {
cmd := btcjson.NewRescanBlockchainCmd(startHeight, stopHeight)
return c.SendCmd(cmd)
}

// RescanBlockchain rescans the local blockchain for wallet related
// transactions from the startHeight to the the inclusive stopHeight.
func (c *Client) RescanBlockchain(startHeight *int64, stopHeight *int64) (*btcjson.RescanBlockchainResult, error) {
func (c *Client) RescanBlockchain(startHeight *int32, stopHeight *int32) (*btcjson.RescanBlockchainResult, error) {
return c.RescanBlockchainAsync(startHeight, stopHeight).Receive()
}

Expand Down

0 comments on commit 662d804

Please sign in to comment.