Closed KnowWhoami closed 2 months ago
Add an assert to check if the count is zero or not.
We don't require that since derive_address
rpc call itself take care of it.
I call get_next_internal_address
with count =0
and got this error:
Should I write doc comments to mention this?
Add an assert to check if the count is zero or not.
We don't require that since
derive_address
rpc call itself take care of it. I callget_next_internal_address
withcount =0
and got this error:
Not exactly. We need to capture deterministic errors in the error propagation chain as early as possible. In this case, capturing the error is especially important because we're making a network call, and we want to avoid intentionally sending a buggy payload. What you're suggesting isn't a good practice.
Now that I think about it, this must be why Belcher didn’t use this approach in the first place—to avoid errors in this situation. Given how vast the address space is, we’re unlikely to exhaust it. It might be better to leave it as is and simply document it.
get_next_hd_index
is called to get the next unused index for the given keychain which derives it from the corresponding descriptor.External
keychain.Parked for BDK.
Edit: see https://github.com/citadel-tech/coinswap/pull/245#discussion_r1732905255 Fixes #242