Skip to content

Commit

Permalink
client: upgrade btc min version required and add min version for desc…
Browse files Browse the repository at this point in the history
…riptor wallets
  • Loading branch information
vctt94 authored and chappjc committed Jul 31, 2022
1 parent 4366db4 commit c60d6f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/asset/btc/btc.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ const (
// redeem transaction.
defaultRedeemConfTarget = 2

minNetworkVersion = 190000
minNetworkVersion = 210000
minProtocolVersion = 70015
// version which descriptor wallets have been introduced.
minDescriptorVersion = 220000

// splitTxBaggage is the total number of additional bytes associated with
// using a split transaction to fund a swap.
Expand Down
4 changes: 4 additions & 0 deletions client/asset/btc/rpcclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ func (wc *rpcClient) connect(ctx context.Context, _ *sync.WaitGroup) error {
}
wc.descriptors = wiRes.Descriptors
if wc.descriptors {
if netVer < minDescriptorVersion {
return fmt.Errorf("reported node version %d is less than minimum %d"+
" for descriptor wallets", netVer, minDescriptorVersion)
}
wc.log.Debug("Using a descriptor wallet.")
}
return nil
Expand Down

0 comments on commit c60d6f2

Please sign in to comment.