Because the health check uses OS specific syscalls for determining the
available space on a disk that aren't available in JS/WASM builds, we
need to make sure we don't reference that code at all. Otherwise we
can't use parts of lnd as a library in projects that are being compiled
down to a WASM binary.
Since bbolt uses syscalls for memory mapping that aren't available in
JS/WASM builds, we need to make sure we don't reference that code at
all. Otherwise we can't use parts of lnd as a library in projects that
are being compiled down to a WASM binary.
We only want to register the bbolt DB backend ("bdb") when we're not
compiling for a JS/WASM build targets. That's why we want to have that
import in only one file that we can add a build tag to. We remove it in
two other places since only one import is enough anyway.
The bucket sequence we use as payment sequence makes the DB update in
InitPayment conflict and therefore queue up when many concurrent
payments happen. This change allocates payment sequences in blocks
of 1000 to avoid these conflicts.
Without this commit, the build may break if a PR commit is created, as
that shows the `PR_NUMBER` field we parse out as "master", reflecting
that its a merge commit into the master branch.
The golang version always needs to be in sync between the go.mod, the PR
checklist and the installation instructions.
We also shorten the Pull Request template by removing everything that we
have a CI check for and just refer to those checks instead.
In this commit, we add a simple bash script to parse out the current PR
number from an environment variable in the GH actions context, and use
that to check to see if the PR has been referenced in the release notes
or not. This isn't 100% fool proof, but it should catch most of the
common cases.
This commit removes an assertion which is not needed because with etcd
we can safely create keys and values with the same key since they are
stored under different keys in the DB. This saves us one unnecessary Get
on every Put.
The etcd cursor Delete stepped to the next item in the range before
Delete to not invalidate the iteation. This is unnecessary and not
compatible with bbolt, resulting in an extra fetch too.
This commit creates the file lnd_misc_test.go to hold all miscellaneous
tests in the file lnd_test.go. From now on, the lnd_test.go will only be
responsible for handling the "top" level functionalities such as
splitting test cases and run them. Newly created test cases should find
their places in the related test files, or create new one when needed.