Give the range to 'importdescriptors' when re-importing a descriptor for
rescanning. This is because the range must include the range of the
descriptor being updated.
Secondly, it is possible that the combination of our timeout-to-1s hack
and our retry logic trigger an edge case: we would retry after
successfully triggering a rescan, and therefore panic on a "a rescan is
already ongoing" error. Instead check before starting that we aren't
rescanning already, and assume that such an error after triggering the
rescan is because we succeeded. That's racy but only reasonably so (as
long as we don't crash, which isn't the case here).
We'll need to store in persistent storage if a rescan was requested by a
user, and if so from what date.
For the SQLite implementation we introduce a rescan_timestamp to the
wallet table.
The query we are going to use to rescan, 'importdescriptors' will block
until the rescan is finished. Stopping the connection through a timeout
immediately after triggering the rescan is a workaround to make it
asynchronous.
Eventually we should probably use 'rescanblockchain' but then it
wouldn't update the timestamps of the descriptors in the watchonly
wallet...
e9fa816be7c6ddbf64413dc4df6940d0f90c1f87 Delete install target datadir in case of failure (edouard)
Pull request description:
close#20
ACKs for top commit:
edouardparis:
Self-ACK e9fa816be7c6ddbf64413dc4df6940d0f90c1f87
Tree-SHA512: 21b78bdad3a3e5127703211e5d119dc9ec88e4bc881ab744e1f6e20d51000af8b5aac4a12f19c775576c69ce958cac7d905378ec8fa4d69e4398fb5fedb61a05
We are passed a timestamp and we want to know down to what height we
should rescan / roll back. That's helpful for it. It was a bit tricky
although it's a simple binary search.. So to make sure i got it right i
made it a standalone function in a utils/ module to be able to unit test
it.
See the TODO, it's theoretically not precisely entirely correct. But
it's good enough for now.
It seems that internally bitcoind might temporarily not have a pprev
pointer for a block. This will result in the optional
"previousblockhash" field to be null and would previously make us crash.
Handle that gracefully.
08505b25452e61a92d5b7eb4a02c893f0d585a91 commands: actually use the change descriptor when creating a Spend (Antoine Poinsot)
Pull request description:
Fixes#78
ACKs for top commit:
darosior:
ACK 08505b25452e61a92d5b7eb4a02c893f0d585a91
Tree-SHA512: 4cccb6636f4e95831a9b3555f6a35cff85d855758b4c26c83b3db8086ea3012af6552ab0db485e982757b68c5c40d6b6696a95bca28c5b5b2f78339bfd800636
3b2c9109dd2c16e3812feb06f322ff0e6b6a61a0 Clippy fixes (Antoine Poinsot)
Pull request description:
Clippy just broke under our feets by enabling more checks and making CI fail...
ACKs for top commit:
darosior:
ACK 3b2c9109dd2c16e3812feb06f322ff0e6b6a61a0
Tree-SHA512: 973f7ae94609209038626a3b6f9ff940d9e488c8588865b439a37a46eec1a5df995013ac98be0fc63e50009339e78238b3a317c568c89677fcb0facf08736874