[Qt][Bug] Load the most recent instead of the first transactions
Fixes a comparator bug when loading the initial `walletTxes` vector.
The design intention is to load the 20k most recent transactions, but it
was loading the first 20k transactions in error, resulting in a
potentially large gap in the UI's transaction history.
Merge #1253: [Qt] Initialize isLoading to false for CS view
d8378031521fe7af44c7d9c82115090e522d8245 [Qt] Initialize isLoading to false for CS view (Fuzzbawls)
Pull request description:
Loading of the cold staking delegations list checks to see if `isLoading`
is true, and exit's out if it is. this check is used to prevent double
loading, but on some systems `isLoading` is initialized as `true`, so
the loading of CS delegations will never occur.
This changes to initialization to be explicitly `false`.
ACKs for top commit:
furszy:
utACK d837803
random-zebra:
utACK d8378031521fe7af44c7d9c82115090e522d8245 and merging...
Loading of the cold staking delegations list checks to see if `isLoading`
is true, and exit's out if it is. this check is used to prevent double
loading, but on some systems `isLoading` is initialized as `true`, so
the loading of CS delegations will never occur.
This changes to initialization to be explicitly `false`.
3893739e76ac804bc8bc7b04019282bbf4f43d46 [RPC] Fix getstakingstatus removing compile-time conditional (random-zebra)
9362e88103cc961d0a977e50c13750998cede83b [Wallet][Cleanup][GUI] minor updates to staking status (random-zebra)
968d8610b546067c257d75eef469d262cc731790 [Wallet] CStakerStatus: save a pointer to the tip instead of the hash (random-zebra)
bb2a987ce6d29bbbb981449d210bc6b0597c250d [GUI] Refactor updateStakingStatus and set it to inactive after locking (random-zebra)
d2aebc5b1e3287ef4d08e48027baf380bed5d8f5 [Trivial] Fix lastHashTime type in miner (random-zebra)
b8ed76fd5be15058efad21d2ddd2f40a88591a85 [RPC] Add CStakerStatus data to getstakingstatus (random-zebra)
d2d5f0818dba5074d54300aee33e515e004e815e [PoS] Lock cs_main when getting chainActive data in miner (random-zebra)
dbc46d864732e58b0f12e70067738e134f96b8d8 [Cleanup] Remove unused variables in miner (random-zebra)
01173e974f1b59ad5292867e093f53bd7f97182f [Core][PoS] Replace mapHashedBlocks and nLastCoinStakeSearchInterval (random-zebra)
6b2b81369a2b7d509c3ebf9891a0b07f50bc741f [Cleanup][Wallet] Remove unused nSearchInterval field in CreateCoinStake (random-zebra)
Pull request description:
This PR cleans up the miner code and streamlines the logic used by the client (both in the RPC and in the GUI) to determine whether the wallet is staking or not.
Currently it relies on a collection of variables (`mapHashedBlocks`, `nLastCoinStakeInterval`, `nSearchInterval`, etc...) updated in kernel.
These are here replaced with a new class `CStakerStatus`, updated in `CreateCoinStake` (thus directly in wallet), and an instance of `CStakerStatus` is introduced as member of CWallet.
This class keeps two variables, `timeLastStakeAttempt ` and `tipLastStakeAttempt`, containing respectively the time of last stake attempt and a pointer to the index of the block upon which last stake attempt was made.
The Staking Status is Active whenever timeLastStakeAttempt is less than
30 seconds in the past.
This PR also expands the output of `getstakingstatus` rpc call adding:
- `staking_enabled` to tell whether or not staking has been disabled via conf file / startup flag
- `hashLastStakeAttempt` and `timeLastStakeAttempt` values
- `heightLastStakeAttempt` (the height of the block with hash `hashLastStakeAttempt`)
- `tiptime` (the time of the chaintip block) to compare with `timeLastStakeAttempt`. This field replaces `valid_time` which is unnecessary now).
and fixes `enoughcoins` with proper staking balance.
ACKs for top commit:
furszy:
Pretty nice cleanup 👌 , ACK 3893739
Fuzzbawls:
ACK 3893739e76ac804bc8bc7b04019282bbf4f43d46
Merge #1242: [RPC] Add coldstaking address support in importprivkey and importaddress
ce93872309a5b6d05fce056ced59ed63d4e716f3 [Trivial][RPC] Fix example line in importprivkey help (missing arg) (random-zebra)
96bdd3ec176e9fd8a588afb99fd9c05a46c7b273 [Tests] Add wallet_import_stakingaddress to test runner (random-zebra)
d1ebf2eb4c7c6a884f9c27decdf32a1730cea61f [Tests] Add functional test for import staking address/key (random-zebra)
3bd557974e343e3792c6b9b0c9fd1e8945ad303c [RPC] Add coldstaking address support in importaddress (random-zebra)
144ec35c97ece1984aa9f2c222978a12fd9ea2d5 [RPC] Add coldstaking address support in importprivkey (random-zebra)
Pull request description:
Still it remains to add proper support in `dumpwallet` and `importwallet`
ACKs for top commit:
Fuzzbawls:
ACK ce93872309a5b6d05fce056ced59ed63d4e716f3