Commit Graph

738 Commits

Author SHA1 Message Date
tomFlowee 73e10f8bef Fix reordering of finding transactions
In our wallet we very rarely end up in a situation where we have to ask
the same transactions twice from a peer due to us having generated a
bunch of new keys from a HD wallet in the middle of a series we asked
that peer. Making the filter we sent at the start of the series be
outdated halfway through.

This is now handled properly.

This adds a unit test which tests that we now reach the right balance
and can add the same block multiple times without it failing.

Fixes: #12
2023-04-04 13:36:07 +02:00
tomFlowee a06a073595 Fix assert, as found by linter. 2023-04-03 11:46:32 +02:00
tomFlowee 6f46a18608 Follow flowee-libs changes
This implements the new API needed for the change in flowee libs.
The commit there is: 1d309cd7ae9bb668b481fe650e17e15fad037b2b
2023-04-01 23:01:37 +02:00
tomFlowee ec8fa4b95d Minor spacing fix 2023-03-29 16:06:12 +02:00
tomFlowee d0f56c85ee Don't send bloom filter more often than needed. 2023-03-29 15:43:22 +02:00
tomFlowee 082cba55ae Comments and const fixes. 2023-03-29 15:42:53 +02:00
tomFlowee 01f87acc28 Add address on QR
This exports the payment-request address to the QML side.
We use this to show under the QR the address we are requesting to send
to.

This is quite useful for users wanting to manually check if things are
going well.
2023-03-21 23:33:23 +01:00
tomFlowee 3bdebe7b8d Introduce GUI settting: show bch.
On the main screen, also known as the "Activity view" this allows the
user to choose to only see fiat or see both Bitcoin Cash and fiat values
listed next to each transaction.
2023-03-21 22:28:41 +01:00
tomFlowee c4836213e5 Remove unused include 2023-03-21 21:55:41 +01:00
tomFlowee 4f595b5a36 Document "Pay" properties. 2023-03-21 21:43:34 +01:00
tomFlowee f05f3d52a3 Fix rounding for negative numbers. 2023-03-15 16:03:19 +01:00
tomFlowee d7963e4d82 Make pasting a payment url work in more usecases
This moves the code simply to a detail, allowing us to parse things like
the amount as well in a bip21 compatible URL in such usage.
2023-03-13 18:17:23 +01:00
tomFlowee 09b03faab7 Make sure that the hamburger menu is removed on broadcast
We now make sure that the menu accessible from the header is only
there when we are actually on the page where it is relevant.
2023-03-13 18:17:23 +01:00
tomFlowee 43c5f250d5 Merge branch 'master' into buildPayment 2023-03-13 12:15:59 +01:00
tomFlowee 697024d823 Fix one more usecase for unknown historical price. 2023-03-13 12:12:42 +01:00
tomFlowee 8b3a85a88b Synchronize property names
This makes the payment detail (output) have the same property name as the
payment itself which was supposed to just be a proxy for a single-output
payment.
Consistency is good.
2023-03-13 11:56:35 +01:00
tomFlowee a6e9001e4c Fix the cent-less currency display
This partly reverts earlier "fix" from 9b87590 and fixes the
problem in the right place.

fixes #13
2023-03-12 20:45:10 +01:00
tomFlowee 9daefb38d2 Start work on the destination edit page 2023-03-11 22:05:15 +01:00
tomFlowee 0659c99b37 Make 'price then' use accurate prices.
If we don't have price info near the mining date, don't show an
inaccurate version.
2023-03-09 22:53:56 +01:00
tomFlowee 784ccfbf38 Allow historical date to be accurate
The backend has the historical prices in its database, we ask for it by
timestamp the by default it returns the nearest value. Typically within
24 hours.

But if the database doesn't have the data, or its very inaccurate, this
may casue confusion.
So we now have a new API call that returns zero instead of an inaccurate
historical price. Allowing us to prefer not showing anything over plain
false data.
2023-03-09 22:46:03 +01:00
tomFlowee fa225772e8 New version 2023-02-25 19:04:47 +01:00
tomFlowee b13f7d353e Make brand new wallets behave better on initial sync
We now skip building (and sending) of the bloom filter until we have
finished the initial blockheader sync. (only relevant for newly created
wallets).

Additionally we update the WalletInfo with our inital blockheight as
soon as we know about it.
2023-02-24 19:45:12 +01:00
tomFlowee e664b033e4 Move shutdown of app singleton to be earlier
The downside of having the application singleton be the owner of the
wallets is that the destructor won't get called until after main() has
been completed.
And that means that globals deletion order becomes an issue, which is
messy and should be avoided.

This change splits out the saving and deletion of wallets & p2p layer,
making use of the Qt application object signal to delete wallets just
before the QtGuiApplication object destructs. Which is _inside_ of
main().
2023-02-24 19:03:22 +01:00
tomFlowee c93dbbeb2e Update amounts in UI 2023-02-22 20:53:15 +01:00
tomFlowee 457edc20b4 Simplify the payment and amounts getters
This merges the paymentAmount and effectiveBchAmount methods because they
did 99% the same.
Same with the paymentAmountFiat and effectiveFiatAmount.

This removes the 'effective*' set of properties.
2023-02-22 15:28:06 +01:00
tomFlowee 63033ab153 Forward the user owned property being changed.
This is useful to see if a default wallet got an incoming transaction.
2023-02-22 15:05:29 +01:00
tomFlowee 0fd3465c7d new version 2023-02-21 20:31:58 +01:00
tomFlowee fadf247838 Add context to translation 2023-02-21 15:52:16 +01:00
tomFlowee a00f21e4e2 Move calculation of fees to c++
Add a property 'fees' to the TransactionInfo class and use it.

This also changes the GUI behavior of the 'sent' field a little.
In the GUI we now show the amount actually meant to arrive on the other
address(es) instead of the amount our wallet became more empty.

This makes a lot of sense if you look at your transaction and compare to
an invoice, now the 'sent' field will match that invoice and it will
match what the receiver actually received.
2023-02-20 18:10:35 +01:00
tomFlowee 5e2e4c1bc4 Fix historical pricing data-state. 2023-02-20 16:20:43 +01:00
tomFlowee 5e2976e803 When we load historical price, emit that change
So the QML that was already loaded can use it.
2023-02-20 10:54:21 +01:00
tomFlowee 44131aa4df Remove no longer used 'mock' method. 2023-02-20 10:52:58 +01:00
tomFlowee aa0a505f8f Add price details popup
Show the current price, historical price-differences and a button to
change the currency.
2023-02-19 18:42:33 +01:00
tomFlowee a8264538c0 Payment::reset() should not delete the exchange rate
to reset the payment removes all user set properties, giving you a clean
payment object.
Since the exchange rate is both not user-set and also not something that
is expected to change between one payment and the next, it is now no
longer cleared on reset().
2023-02-18 16:25:33 +01:00
tomFlowee 155647d7ac Add docs and make input selector work again
Document various of the Payment properties better and make the input
selector use the multi-detail getter for price.
2023-02-17 19:22:24 +01:00
tomFlowee 9f39a9f54f Make the logic simpler
Move the logic for fiat to the payment object too and simplify the need
for code by defining this can only be called in the single-output mode.
2023-02-08 20:55:24 +01:00
tomFlowee f1f0f113d7 Remove some of the camera work arounds
Since we have seen a lot of bugfixes in the multimedia library, we can
make this all faster and simpler.
2023-02-08 18:23:18 +01:00
tomFlowee 9b87590bd9 Fixes in currency number construction
Now tested with more currencies.
2023-02-08 18:23:18 +01:00
tomFlowee a2969750c9 Fully switch currency on failure.
Also add some logging and add an emit on the new currency being set
because sometimes the fetch from server takes very long.
2023-02-08 14:29:02 +01:00
tomFlowee a475a99371 Add feature: autoprepare
For the payment object it now is possible to insta-commit to changes and
as such always prepare a transaction ready to be sent with the latest of
the settings.

This is enabled with a boolean property 'autoPrepare' (default off).
2023-02-08 14:14:06 +01:00
tomFlowee 7b1333862c Make the non-detailed payment API use 'max'.
The Payment::paymentAmount() method is for the usecase where the GUI
doesn't care about the input/output details.
Its unused in the desktop GUI.

This method now takes into account the concept of 'max', returning the
full wallet amount if its set.
2023-02-08 10:23:28 +01:00
tomFlowee 6c95cd3c09 Make currency changes persist between restarts. 2023-02-07 17:51:29 +01:00
tomFlowee 00dae95023 Allow changing of the currently used currency.
Provide a QML point where a different locale can be given for a different
currency. This then swaps out the historical file to the new one and
fetches from the online stream in that currency.
2023-02-07 14:38:33 +01:00
tomFlowee 69b82238ec New main year. 2023-02-05 22:42:37 +01:00
tomFlowee 8ae25cbf64 Refactor Fiat and historical.
Move the historical fiat prices to share the API with the current ones
and avoid complicating the code in the GUI layer (one less object).
2023-02-03 19:59:02 +01:00
tomFlowee 0fad45975b Cleanup 2023-02-03 19:57:40 +01:00
tomFlowee 9b1ec8e271 Make coinbase maturation smarter.
Instead of recalculating every single block, we now use the existing
locking of UTXOs feature to lock coinbase outputs to a certain
maturation height.
This is the traditional trade-off where we store some more data to
avoid work in the common codepath.
2023-02-02 12:49:18 +01:00
tomFlowee 8b4e264c1d Make grammar of comment easier to understand. 2023-02-02 12:48:57 +01:00
tomFlowee 28d787b9c1 On app shutdown, unsubscribe listeners. 2023-01-31 20:36:40 +01:00
tomFlowee caa340768f Make 'chainHeight' property on Pay work better
We now show the estimated tip until the headers chain has been synched.

This follows p2pnet listener interfaces changes.
This uses the nicer interfaces setup to make available for FloweePay
the signal that we have reached the tip of the headerChain
2023-01-31 20:36:12 +01:00