aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletmodel.h
AgeCommit message (Collapse)Author
2020-06-22qt: Fix regression in TransactionTableModelHennadii Stepanov
Since #17993 a crash is possible on exit. Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
2020-05-29Merge #17993: gui: Balance/TxStatus polling update based on last block hash.Jonas Schnelli
a06e845e826acaeb0db7cf02b2519c177e94dee5 BlockTip struct created and connected to notifyHeaderTip and notifyBlockTip signals. (furszy) 2f867203b0c7a4438ce484be4cfa2b29dbf1abf0 Added best block hash to the NotifyHeaderTip and NotifyBlockTip signals. (furszy) Pull request description: Rationale: The height based polling in the GUI is an issue on chain reorgs. Any new tip signal with the same height as the one that it's cached in the model was not triggering the GUI update (interpreting it as the same same block when it could receive a different one). Ending up with bad information presented in the GUI. This PR essentially changes the last cached height to be a last cached block hash. --- Old historical information of this PR. As the tip height is cached and updated via signaling in clientModel, there is no need to continue locking `cs_main` on every balance poll (`m_node.getNumBlocks()` method call). Extra topic: Would suggest to change the `cachedNumBlocks` field inside `walletModel` to a more understandable name, maybe `nLastBalanceUpdateHeight`. And finally, this will have the equal height reorg issue mentioned [here](https://github.com/bitcoin/bitcoin/pull/17905#issuecomment-577324304), whatever is presented to fix it, this should use the same flow too. **[Edit - 24/01/2020]** Have added #[17905](https://github.com/bitcoin/bitcoin/pull/17905#issuecomment-577324304) comment fix here too. ACKs for top commit: jonasschnelli: utACK a06e845e826acaeb0db7cf02b2519c177e94dee5 - it would be great to have QT unit tests (in this case for a reorg) that either automatically inspect the window content based on accessibility and tests for expected values or at least allow for quick manual re-testing (screenshots, automatically create UI situations). hebasto: re-ACK a06e845e826acaeb0db7cf02b2519c177e94dee5, suggested style changes implemented since the [previous](https://github.com/bitcoin/bitcoin/pull/17993#pullrequestreview-417249705) review. ryanofsky: Code review ACK a06e845e826acaeb0db7cf02b2519c177e94dee5. A lot of changes since the last review: rebase after sync_state introduction #18152 and tryGetBalances revert #18587, reverting getLastBlockTime change, fixing spacing and initializations and renaming some variables Tree-SHA512: 835e587a8296df9899cccd7b3e598a5970942b640e432e6a32de0b4eaea5b40f9271258f089ec033595311707b74a0f7187ecf8ed397c713e1153e2714072975
2020-05-29Merge #17918: qt: Hide non PKHash-Addresses in signing address bookJonas Schnelli
c4ea501e96363e937200bc97b8e2d78162bdb699 qt: Hide non PKHash-Addresses in signing address book (Emil Engler) Pull request description: [Video Demo](https://www.youtube.com/watch?v=T-Rp2pFRmzY) This PR hides all non PKHash addresses in the signing GUI in the Address Book when it is opened through the signing dialog, as non PKHash addresses are useless there. ACKs for top commit: jonasschnelli: Code Review ACK c4ea501e96363e937200bc97b8e2d78162bdb699 Tree-SHA512: e321d45e15534b2d68da5a1297b1c7551cdd784f03203f54c9385c2ce0bb2b7316c09f9e8c3eb41bfa1e7207ecc94c8ed08f012e2d6c117b803996ade26feb2f
2020-05-23Added best block hash to the NotifyHeaderTip and NotifyBlockTip signals.furszy
[ClientModel] best header/block hash cached.
2020-05-01Cancel wallet balance timer when shutdown requestedRussell Yanofsky
This doesn't fix any current problem, but it makes balance checking code less fragile, and prevents use-after free travis error in next commit: https://travis-ci.org/github/bitcoin/bitcoin/jobs/675367629#L4240
2020-05-01Switch transaction table to use wallet height not node heightRussell Yanofsky
Tweak of #17905 to make gui display of transactions and balances more consistent. This change shouldn't cause visible effects in normal cases, just make GUI wallet code more internally correct and consistent.
2020-04-16scripted-diff: Bump copyright headersMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2020-04-10Merge #17905: gui: Avoid redundant tx status updatesMarcoFalke
96cb597325f64cadb3cf43e2cdb3d7c1e2e49891 gui: Avoid redundant tx status updates (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). In `TransactionTablePriv::index`, avoid calling `interfaces::Wallet::tryGetTxStatus` if the status is up to date as of the most recent `NotifyBlockTip` notification. Store height from the most recent notification in a new `ClientModel::cachedNumBlocks` variable in order to check this. This avoids floods of IPC traffic from `tryGetTxStatus` with #10102 when there are a lot of transactions. It might also make the GUI a little more efficient even when there is no IPC. ACKs for top commit: promag: Code review ACK 96cb597325f64cadb3cf43e2cdb3d7c1e2e49891. hebasto: ACK 96cb597325f64cadb3cf43e2cdb3d7c1e2e49891 Tree-SHA512: fce597bf52a813ad4923110d0a39229ea09e1631e0d580ea18cffb09e58cdbb4b111a40a9a9270ff16d8163cd47b0bd9f1fe7e3a6c7ebb19198f049f8dd1aa46
2020-03-19refactor: Get rid of Wallet::IsWalletFlagSet methodRussell Yanofsky
Replace by privateKeysDisabled method to avoid need for GUI to reference internal wallet flags. Also remove adjacent WalletModel canGetAddresses wrapper that serves no purpose and make Wallet::canGetAddresses non-const so it can be implemented by IPC classes in #10102.
2020-01-18qt: Hide non PKHash-Addresses in signing address bookEmil Engler
2020-01-09gui: Avoid redundant tx status updatesRussell Yanofsky
In TransactionTablePriv::index, avoid calling interfaces::Wallet::tryGetTxStatus if the status is up to date as of the most recent NotifyBlockTip notification. Store height from the most recent notification in a new ClientModel::cachedNumBlocks variable in order to check this. This avoids floods of IPC traffic from tryGetTxStatus with #10102 when there are a lot of transactions. It might also make the GUI a little more efficient even when there is no IPC.
2019-11-19refactor: Move SendCoinsRecipient in own headerHennadii Stepanov
Co-authored-by: Gregory Sanders <gsanders87@gmail.com>
2019-10-29wallet: Remove left-over BIP70 commentFabian Jahr
2019-10-26Merge #17120: gui: Fix start timer from non QThreadWladimir J. van der Laan
a8f5026d6d992fd8d72908c848c5028f0f9a8cd1 gui: Fix start timer from non QThread (João Barbosa) Pull request description: Fixes #16296. ACKs for top commit: laanwj: code review ACK a8f5026d6d992fd8d72908c848c5028f0f9a8cd1 Tree-SHA512: d7b05ac88e188de16cbbe80cb2f773b7976ee07ee876ac94a93f9351856c4f3a9d66a531d3f3748d2dccff8c8d77d9d8227433069ed5909c32be2efeaa32f655
2019-10-24Remove BIP70 Supportfanquake
2019-10-24Merge #17154: wallet: Remove return value from CommitTransactionWladimir J. van der Laan
9e95931865186d7a9a6dc54b64bd96507e9fea4b [wallet] Remove `state` argument from CWallet::CommitTransaction (John Newbery) d1734f9a3b138ab046f38ee44a09bc3847bf938a [wallet] Remove return value from CommitTransaction() (John Newbery) b6f486a02b463ffeaf82ec11fc6f74f439c037ae [wallet] Add doxygen comment to CWallet::CommitTransaction() (John Newbery) 8bba91b22d22a8dfea7c947b542b1022bfc1c0ea [wallet] Fix whitespace in CWallet::CommitTransaction() (John Newbery) Pull request description: `CommitTransaction()` returns a bool to indicate success, but since commit b3a7410 (#9302) it only returns true, even if the transaction was not successfully broadcast. This commit changes CommitTransaction() to return void. All dead code in `if (!CommitTransaction())` branches has been removed. Two additional commits fix up the idiosyncratic whitespace in `CommitTransaction` and add a doxygen comment for the function. ACKs for top commit: laanwj: ACK 9e95931865186d7a9a6dc54b64bd96507e9fea4b Tree-SHA512: a55a2c20369a45222fc0e02d0891495655a926e71c4f52cb72624768dd7b9c1dca716ea67d38420afb90f40c6e0fd448caa60c18fd693bb10ecb110b641820e6
2019-10-18[wallet] Remove return value from CommitTransaction()John Newbery
CommitTransaction returns a bool to indicate success, but since commit b3a74100b8 it only returns true, even if the transaction was not successfully broadcast. This commit changes CommitTransaction() to return void. All dead code in `if (!CommitTransaction())` branches has been removed.
2019-10-15Remove unused includespracticalswift
2019-10-14gui: Fix start timer from non QThreadJoão Barbosa
2019-05-09Give WalletModel::UnlockContext move semanticsPieter Wuille
2019-01-23Notify the GUI that the keypool has changed to set the receive buttonAndrew Chow
Whenever the keypool changes (new keys generated, new seed set, keypool runs out, etc.), notify the GUI that the keypool has changed. The receive button can then be enabled and disabled as necessary.
2019-01-21Check for more than private keys disabled to show receive buttonAndrew Chow
2019-01-13Don't use zero as null pointer constant (-Wzero-as-null-pointer-constant)practicalswift
Qt-only changes.
2019-01-09Merge #15109: refactor: Use C++11 default member initializersWladimir J. van der Laan
fa2510d5c1cdf9c2cd5cc9887302ced4378c7202 Use C++11 default member initializers (MarcoFalke) Pull request description: Changes: * Remove unused constructors that leave some members uninitialized * Remove manual initialization in each constructor and prefer C++11 default member initializers This is not a stylistic change, but a change that avoids bugs such as: * fix uninitialized read when stringifying an addrLocal #14728 * qt: Initialize members in WalletModel #12426 * net: correctly initialize nMinPingUsecTime #6636 * ... Tree-SHA512: 0f896f3b9fcc464d5fc7525f7c86343ef9ce9fb13425fbc68e9a9728fd8710c2b4e2fd039ee08279ea41ff20fd92b7185cf5cca95a0bcb6a5340a1e6f03cae6b
2019-01-05Use C++11 default member initializersMarcoFalke
2019-01-04qt: Factor out WalletModel::getDisplayName()João Barbosa
2018-10-09build: Add --disable-bip70 configure optionWladimir J. van der Laan
This patch adds a --disable-bip70 configure option that disables BIP70 payment request support. When disabled, this removes the dependency of the GUI on OpenSSL and Protobuf.
2018-08-20Merge #12818: [qt] TransactionView: highlight replacement tx after fee bumpMarcoFalke
d795c610d3 [qt] TransactionView: highlight replacement tx after fee bump (Sjors Provoost) Pull request description: Consistent with #12421 which highlights the transaction after send. <img width="747" alt="1" src="https://user-images.githubusercontent.com/10217/38036280-a7358ea4-32a6-11e8-8f92-417e9e1e3e8b.png"> <img width="685" alt="2" src="https://user-images.githubusercontent.com/10217/38036289-aac87040-32a6-11e8-9f94-81745ff6c592.png"> ~I'm not too proud of the `QTimer::singleShot(10` bit; any suggestions on how to properly wait for the transactions table to become aware of the new transaction?~ Although I could have called `focusTransaction()` directly from `TransactionView::bumpFee()` I'm using the same signal as the send screen. This should make it easier to move fee bump / transaction replacement functionality around later. Tree-SHA512: 242055b7c3d32c7b2cf871f5ceda2581221902fd53fa29e0b092713fc16d3191adbe8cbb28417d522dda9febec8cc05e07afe3489cd7caaecd33460c1dde6fbc
2018-08-01[qt] TransactionView: highlight replacement tx after fee bumpSjors Provoost
2018-07-27Update copyright headers to 2018DrahtBot
2018-07-12[Qt] Disable creating receive addresses when private keys are disabledJonas Schnelli
2018-06-18ui: Support wallets unloaded dynamicallyJoão Barbosa
2018-04-25[tests] [qt] Add tests for address book manipulation via EditAddressDialogJames O'Beirne
Also modifies corresponding QT code to allow for use within test cases.
2018-04-07scripted-diff: Avoid `interface` keyword to fix windows gitian buildRussell Yanofsky
Rename `interface` to `interfaces` Build failure reported by Chun Kuan Lee <ken2812221@gmail.com> https://github.com/bitcoin/bitcoin/pull/10244#issuecomment-379434756 -BEGIN VERIFY SCRIPT- git mv src/interface src/interfaces ren() { git grep -l "$1" | xargs sed -i "s,$1,$2,g"; } ren interface/ interfaces/ ren interface:: interfaces:: ren BITCOIN_INTERFACE_ BITCOIN_INTERFACES_ ren "namespace interface" "namespace interfaces" -END VERIFY SCRIPT-
2018-04-04Use WalletBalances struct in QtRussell Yanofsky
Suggested by John Newbery <john@johnnewbery.com> https://github.com/bitcoin/bitcoin/pull/10244#discussion_r177504284
2018-04-04Remove direct bitcoin calls from qt transaction table filesRussell Yanofsky
2018-04-04Remove direct bitcoin calls from qt/paymentserver.cppRussell Yanofsky
2018-04-04Remove direct bitcoin calls from qt/coincontroldialog.cppRussell Yanofsky
2018-04-04Remove most direct bitcoin calls from qt/walletmodel.cppRussell Yanofsky
2018-03-26Merge #12610: Multiwallet for the GUIJonas Schnelli
779c5f984 Qt: hide RPCConsole wallet selector when no wallets are present (Jonas Schnelli) dc6f150f3 Qt: show wallet name in request dlg in case of multiwallet (Jonas Schnelli) 4826ca4b8 Qt: show wallet name in send confirmation dlg in case of multiwallet (Jonas Schnelli) cfa4133ce GUI: RPCConsole: Log wallet changes (Luke Dashjr) b6d04fc7c Qt: Get wallet name from WalletModel rather than passing it around (Luke Dashjr) 12d8d2681 Qt: When multiple wallets are used, include in notifications the name (Jonas Schnelli) d1ec34a76 Qt: QComboBox::setVisible doesn't work in toolbars, so defer adding it at all until needed (Luke Dashjr) d49cc70e6 Qt: Add wallet selector to debug console (Jonas Schnelli) d558f44c5 Bugfix: RPC: Add missing UnregisterHTTPHandler for /wallet/ (Luke Dashjr) 85d531971 Qt: Ensure UI updates only come from the currently selected walletView (Luke Dashjr) e449f9a9e Qt: Add a combobox to toolbar to select from multiple wallets (Luke Dashjr) 3dba3c3ac Qt: Load all wallets into WalletModels (Luke Dashjr) Pull request description: This is an overhaul of #11383 (plus some additions). It avoids unnecessary coupling of httpserver/jsonrpc and the wallet as well as it avoids pointer pure passing (and pointer deletion) of `CWallet` (plus other minor design changes). Additionally it adds the wallet name to the sendconfirmation and request dialog (in case multiwallet is active) Tree-SHA512: 3d06e18badbc5d1821e488bf1dae463bb0be544cf11b2b618e025812bfdd13c5f39604bb93b4c705313930e7dc4e66f4848b9469ba14871bade58e7a027246a1
2018-03-26Qt: When multiple wallets are used, include in notifications the nameJonas Schnelli
2018-03-26Qt: Add wallet selector to debug consoleJonas Schnelli
2018-03-17wallet: Change output type globals to membersMarcoFalke
2018-03-06Qt: Ensure UI updates only come from the currently selected walletViewLuke Dashjr
2018-02-19Split key_io (address/key encodings) off from base58Pieter Wuille
2018-01-16[qt] receive tab: bech32 address opt-in checkboxSjors Provoost
When launched with -adresstype=legacy the checkbox will be hidden.
2018-01-03Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa
2017-12-22[Wallet] Use RBF by default in QT onlySjors Provoost
GUI wallet uses RBF by default, regardless of -walletrbf. RPC and debug console in the GUI remain unchanged; they don't use RBF by default, unless launched with -walletrbf=1.
2017-11-16scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider
-BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
2017-09-05qt: Use IsMine to validate custom change addressChris Moore
(cherry picked from commit c41224dfd51c896341bbf2fa23e160bf5ffe27c3)