ThomasV
bca0f31fca
coinchooser methods should not belong in wallet class
9 years ago
Justin Turner Arthur
46907e97c1
Remove penalty_func from CoinChooserPrivacy that is later implemented/redefined.
Probably a copy pasta from the development process.
9 years ago
ThomasV
305843999e
Relicensing
9 years ago
Neil Booth
97bc1b2788
Don't split small change
9 years ago
ThomasV
d200b236ae
replace tx.input, tx.output by methods, so that deserialize calls are encapsulated
9 years ago
Neil Booth
f1bb3e846d
Remove unused import
9 years ago
Neil Booth
15707b5590
Coin chooser: use deterministic randomness
9 years ago
ThomasV
eb085c2e23
Clarify preferences dialog:
* rename 'Oldest First' policy as Priority
* show multiple change and fee multiplier on separate lines
9 years ago
Neil Booth
6bf91b8ae2
Update comments and tooltips.
9 years ago
Neil Booth
53fa973898
Move change_amounts() to base class.
Update tooltip of the preference.
9 years ago
ThomasV
0d52911561
define constants for tx output types
9 years ago
Neil Booth
0a3d74de8f
Avoid index-out-of-range
Also add sanity assertion
9 years ago
Neil Booth
25a2ceda23
Fix copyright.
9 years ago
Neil Booth
5c3a6db445
Fix negative amounts assertion
Change amounts could be negative after deducting the cost of the extra
change output; floor them at zero. Move the assertion to the main
code. Simplify rounding logic.
9 years ago
Neil Booth
cead9cd7c6
Ensure zeroes is always non-empty.
9 years ago
Neil Booth
1c528af433
Description tweaks.
Mention loss of priority, and rename Classic to Oldest First.
9 years ago
Neil Booth
36aaad392d
Fix docstring display.
9 years ago
Neil Booth
2763b0feea
Improved change handling for Privacy chooser
Breaks up large change in such a way as to make it
unclear what the real send might be.
Fixes #1203
9 years ago
Neil Booth
ea49e8dc96
Remove unneeded buckets for Privacy coin chooser
Commonize the code with the classic chooser and simplify.
9 years ago
Neil Booth
75b3ecee49
Add coin chooser to try and minimize loss of privacy.
9 years ago
Neil Booth
e302dbc71c
Move debug output to end of function.
9 years ago
Neil Booth
9a6dcf7b1e
Use bucketing to choose coins
Bucketing is generalization of coin chooser logic that makes it easy
to implement other algorithms.
- Put core coin chooser functionality in base class.
- Specialize derived class to implement classic electrum algorithm of
oldest coins first. One bucket per output.
No intended change in behaviour.
Coin chooser now sorts the coins as it wants; remove redundant sorting
from get_spendable_coins().
9 years ago
Neil Booth
93bb09230c
Track tx size directly; calculate fees from that
This has several advantages. Fee calculation is now very fast,
as we don't need to keep reserializing the tx. Another is that
we can reason about the fees after adding a change output without
having to add it, recalculate the tx fee, and remove it again.
9 years ago
Neil Booth
a4dd5acc48
Prepare to calculate tx fee given a tx size
9 years ago
Neil Booth
530dc16ed2
Remove unused import
9 years ago
Neil Booth
8785b65a1f
Remove need for coin chooser to take a wallet
9 years ago
Neil Booth
a6ea9a0c71
Simplify interface to make_tx in coin chooser
Makes the coin chooser code simpler and easier to understand.
9 years ago
Neil Booth
90dee43998
Move estimated_fee to Transaction class
It's not a function of the wallet but of the transaction
so it more naturally belongs there.
9 years ago
Neil Booth
e9061ea371
Move coin choosing logic to own class
This contains no change in logic, but is preparation for cleanup
and possible alternative strategies.
9 years ago