A fix for a bug introduced by #2168
Previously, config.Host worked in the following way:
1. Documented as supporting ip addresses only
2. In fact supported "host/path" syntax
3. Did not support "scheme" prefixes, i.e. https://
Not sure this is the desired approach, probably the best thing would
have been to extend config to contain "Scheme" and "Path" fields as well.
However, this was the way it worked.
1. Now Host can contain scheme prefixes "unix://..."
2. Host can no longer contain ".../path"
This PR solves this behavior while maintaining support of the "unix://" flow
as well.
For some reason, "scheme" is named "network" in #2168 - I did not change that.
Also remove disambiguation in "network:address:port", where it parsed
"myhost:8888" as network:address instead address:port.
Added type alias BTC/kvB to explicitly indicate that
it represents the fee in BTC for a transaction size of 1 kB.
Because bitcoind uses its own fee rate type
(BTC/kvB instead of sat/kWU we use in lnd),
define the type in btcjson package,
as it's the only place where we actually use BTC/kvB.
defaultMaxFeeRate was set to 1e8 / 10(sat/kb) as a parameter.
But BTC/kvB is the expected value, so the units was wrong.
This commit updates defaultMaxFeeRate to BTC/kvB and sets it to 0.1,
which is the default value of Bitcoin Core.
This commit also updates the comment to reflect the change.
Because maxFeeRate sanity check has been added in
bitcoin core v27.0 or later,
sendrawtransaction cannot be executed without this change.
This commit adds detailed errors for all possible errors returned from
`sendrawtransaction` or `testmempoolaccept`, enabling upstream callers
to have refined control over the actions to be taken.
This commit adds a new interface, `BackendVersion`, to support checking
versions for multiple both btcd and bitcoind. Once neutrino version is
also pinned here, it should also be checked.
This commit makes sure the batch requests are always GCed before sending
back the responses for them. In particular,
- `removeRequest` didn't remove the item from `batchList`, which is now
fixed.
- `Send` didn't remove the request from `requestMap`, which is now fixed
by using `removeRequest`.
This commit creates a `RejectReasonMap` to map the errors returned from
`btcd` to bitcoind's `testmempoolaccept` so the `RejectReason` is
unified at the RPC level. To make sure the map keys are unique, the
error strings are modified in `btcd`.
This commit adds bitcoind version 22.0 and 25.0 to our `BackendVersion`
set to handle the `testmempoolaccept` RPC calls. A unit test is added to
make sure the parser works as expected.
now testing that GetBestBlockHashAsync sends the getbestblockhash command via websocket connection and that the channel returned can be used to send the response when it is received
rpcclient now support calling the getchaintips rpc call.
getchaintips_test.go adds test for the getchaintips rpc call. The test
includes hard-coded blocks which the test will feed the node via rpc and
it'll check that the returned chain tips from the getchaintips call
are chaintips that we expect to be returned.
The doc formatting changes introduced in the recent go version is
increasing the diff for all of the new commits. Formatting it all in
this commit will help the readability of future PRs by reducing the
diff.
This commit fixes the error that is masked inside the for loop's scope.
Previously after max retries the error didn't leave the for scope and
therefore httpResponse remained nil which in turn resulted in a crash.
This reverts the previous breaking change to the GetNewAddress and
GetRawChangeAddress rpcclient.Client methods, and adds the methods
GetNewAddressType and GetRawChangeAddressType for requesting
an address of a certain type. This change allows the rpcclient package
to continue to work with versions of the btcwallet app that do not
recognize the address type parameter.