Commit Graph

22 Commits

Author SHA1 Message Date
tomFlowee 8e0c7c57e6 Follow Streaming::pool() refactor
This upstream refactor stopped passing in the pool by pointer and
now wraps it in a shared_ptr.

A lot less 'address-of' operators and generally cleaner code are
the result.
2023-12-22 16:46:23 +01:00
tomFlowee 47746e724d Follow upstream includes rename
The PublicKey. and PrivteKey.h used to be called different.
2023-11-24 18:20:41 +01:00
Calin Culianu 95ff48c314 Implement reviewer suggestion plus fixes
In addition:

- Made it work with latest commit to Flowee/thehub/#5.
- Works better now when decrypting the wallet (accountInfo.isElectrum property
  should not be CONSTANT but instead notify on change)
- Made the actual wallet seed phrase type get saved to the wallet rather
  than a bool. This type comes from enum HDMasterKey::MnemonicType in
  thehub libs.
2023-10-19 18:26:50 +03:00
Calin Culianu d2550aee3f Add support for importing wallets using Electrum mnemonic phrases
This is the format used by (older) Electron Cash wallets. It may be
useful to users wishing to use their older EC wallets with Flowee Pay.

Highlight of changes:

- Import wallet UI now auto-detects whether it's Electrum or BIP39. Note
  that in some cases a valid BIP39 seed is also a valid Electrum seed.
  The user has a UI element checkbox for "forcing" Electrum
  interpretation in such cases.
- Electrum seed phrases always use derivation path "m/" so this is
  forced on the user as the only path available in the Electrum case.
- Wallet file format has a new tag to indicate whether the seed phrase
  is electrum or not. Only present in the electrum case, otherwise it's
  omitted from the serialized data.
2023-10-19 18:26:50 +03:00
tomFlowee a12eba7c6d Avoid sending duplicate filters.
The backend will tell us that there is good reason to believe the remote
needs to get a new bloom filter, which is causing a lot of extra traffic
if there actually is no change in the utxo of the wallet.

This introduces a bool to mark changes that would affect the bloom
filter to be send, and only upload a new one when that bool is true.
2023-08-17 20:10:12 +02:00
tomFlowee 8d2f056aac Detect cashtokens being sent to us.
Instead of silently ignoring a cashtoken that is for us, this makes us
match the incoming transaction and remember its a token.
2023-06-04 21:40:46 +02:00
tomFlowee 3dd39e2f64 Add API docs. 2023-05-15 12:46:02 +02:00
tomFlowee a209bc64d2 Make the saving of the wallet-list instantly on encrypt
Call the saving of the wallet-list directly after we encrypted a wallet,
avoiding any delay in saving.

Fixes: #17
2023-05-11 22:19:48 +02:00
tomFlowee fadecb369c Expand the transaction-info page.
Add a lot more userful information to the mobile transaction-info page.
2023-05-06 17:02:06 +02:00
tomFlowee 4ba71ff870 Improve payment-request tracking
We introduce a new WalletkeyView which is a class that provides a
thread-safe view on a single private-key in the wallet. Detecting all
transactions depositing money in that key and thus being an ideal
backend for the PaymentRequest.
2023-05-02 10:52:37 +02:00
tomFlowee d0b5134527 Create a functional Payment Request screen.
We now use a better design where the PaymentRequest object is owned by
QML.
2023-05-02 10:52:37 +02:00
tomFlowee 1e73c5bee5 Step one of rebuilding the payment-requests
This mostly removes the less than successful architecture.

This architecture stems from my first attempts at mixing C++ and QML, and
its not great.
As we can see from the removals, it touches a lot of places and
especially the wallet owning them is messy, but in QML we have to do a
lot of null pointer checks, also not exactly readable.
Lets try something different.
2023-05-02 10:52:37 +02:00
tomFlowee b6d895e8f5 Fix anythingNew to also check for blockheight
This means that an unconfirmed transaction doesn't stop it getting newly
added, which is needed to mark it as mined.
2023-04-17 22:47:18 +02:00
tomFlowee 309c4256e7 Special import feature for bigger bloom filters.
Fixes: #14

During import we now always send all change addresses to be monitored
for activity, even if they are empty.
The behavior of not reusing an address after its been emptied is not
universal and as such the import should account for this.

The privacy issue is really not harmed by this during import, as we
basically send all the addresses in a relatively short timespan to the
peer anyway.
2023-04-17 22:41:27 +02:00
tomFlowee b1320899e9 Optimize the newTransactions to avoid work
Don't do any work when the transactions that are being added are all
already known.
This is common when we send a merkleblock request to some peer after we
already have received the answer before. For instance when we double
check nothing is being omitted by some other peer.
2023-04-17 19:29:55 +02:00
tomFlowee adc7edb250 Make the wallet emit tx removals
Now the wallet handles inserts-in-place by making removing and then
re-adding of transactions, the 'txIndex' is no longer guarenteed to live
forever.
So we now tell the world, and specifically the history model, about the
removal of txIIndexes.
2023-04-05 19:41:40 +02:00
tomFlowee 88f1d81443 Make sure we send the bloom filter a lot less often
One notable behavior change is that we increase the 'change' gap
considerably for wallets that are known to have 'cashfusion'
transactions as those use a lot of change addresses.

This chang also increases the normal gap to avoid people losing history
when importing from another wallet.
2023-04-05 18:07:09 +02:00
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 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 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 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
tomFlowee 163e615613 Move sources into the src subdir
Slowly the amount of cpp sources has been growing to the point
where its just too much to store in the root of the project.
I think they are more happy in a subdir as well, getting an elevated
position for themselves.
2022-12-13 11:54:03 +01:00