A commit_hash component was added to the version string:
"loop version 0.31.2-beta commit=v0.31.2-beta-dirty commit_hash=xxx".
As .* is greedy, it captured "0.31.2-beta commit=v0.31.2-beta-dirty"
instead of just "0.31.2-beta".
This commit fixes this.
Added option WithSkippedTxns, which has one historical problematic tx by default.
Sweeps originating from these transactions are omitted when reading from DB.
loopdb: add column sweep_batches.cancelled and replaced DropBatch with
CancelBatch. It is needed, because sweep.batch_id is a foreign key to batch.
Changed StoreMock.InsertSweepBatch not to reuse batch_id. This is needed by
the test, which checks that new batch has fresh ID.
Add fields ConfChan and ConfErrChan to SpendNotifier type which is a part of
SweepRequest passed to AddSweep method.
This is needed to reuse confirmation notifications on the calling side the same
way it is done for spending notifications.
Previously, dbBatch had a State field (enum: Open, Closed, Confirmed), but in
the database it is represented as a boolean Confirmed. The Closed state was
stored the same way as Open. This wasn't an issue in practice, since an Open
batch is quickly transitioned to Closed after startup.
However, the in-memory mock stores plain dbBatch instances, leading to
inconsistent behavior between the mock and the real DB-backed store. This
commit updates dbBatch to match the database representation by replacing
the State field with a Confirmed boolean.
Function monitorSpendAndNotify used to cancel the context passed to
RegisterSpendNtfn right after starting the goroutine processing results.
Spend notifications were missed.
Now the context is canceled when the goroutine finishes.
Update the output of the `commit_hash` field in the GetInfoResponse.
The `commit_hash` field will contain the most recent commit_hash that
the build was based on. If the build had uncommitted changes, this field
will contain the most recent commit hash, suffixed by "-dirty".
Note that this change also changes the output of `commit` field in the
`--version` command. The `Commit` field will now contain most recent git
commit tag.
If the notification manager shuts down, sweepReqs channel is closed and sweepReq
object received from it becomes nil, causing panic in handleLoopInSweepReq. Now
this is fixed by checking if the channel was closed and if it was shutting down
loop-in manager itself.