Commit graph

179 commits

Author SHA1 Message Date
Pieter Wuille fa2637a3be Always require OS randomness when generating secret keys 2016-05-29 01:52:17 +02:00
Patrick Strateman 380498aba4 Move BackupWallet to CWallet::BackupWallet 2016-05-16 17:48:25 -07:00
Patrick Strateman ecb9741ec3 Move GetAccountBalance from rpcwallet.cpp into CWallet::GetAccountBalance 2016-05-16 17:48:25 -07:00
Gregory Maxwell d87b198b73 Remove unneeded feerate param from RelayTransaction/AcceptToMemoryPool. 2016-05-16 04:10:06 +00:00
Wladimir J. van der Laan 373b50deba
Merge #8028: Fix insanity of CWalletDB::WriteTx and CWalletTx::WriteToDisk
0fd5997 Fix insanity of CWalletDB::WriteTx and CWalletTx::WriteToDisk (Patrick Strateman)
2016-05-10 15:51:34 +02:00
Wladimir J. van der Laan 3e2c946cfd init: Move berkeleydb version reporting to wallet
Move the version reporting to Wallet::Verify, before starting
verification of the wallet.

This removes the dependency of init on a specific wallet database
library.

A further, trivial step towards resolving #7965.
2016-05-10 12:57:07 +02:00
Patrick Strateman 0fd599767d Fix insanity of CWalletDB::WriteTx and CWalletTx::WriteToDisk 2016-05-09 00:20:17 -07:00
Jonas Schnelli 04eaa90958
Add more clear interface for CoinControl.h regarding individual feerate 2016-05-06 11:01:50 +02:00
Jonas Schnelli 3b35e4896b
[RPC] add feerate option to fundrawtransaction 2016-04-28 22:04:07 +02:00
Wladimir J. van der Laan 46880ed2fd
Merge #7688: List solvability in listunspent output and improve help
c3932b3 List solvability in listunspent output and improve help (Pieter Wuille)
2016-04-25 14:46:29 +02:00
Wladimir J. van der Laan 0c95ebce7e
Merge #7816: [Wallet] slighly refactor GetOldestKeyPoolTime()
9f7336b [Wallet] slightly refactor GetOldestKeyPoolTime() (Jonas Schnelli)
2016-04-22 08:36:56 +02:00
Wladimir J. van der Laan 04a2937357
Merge #7787: [Moveonly] Create ui_interface.cpp
fa10ce6 Move ui_interface.cpp to libbitcoin_server_a_SOURCES (MarcoFalke)
fabbf80 [ui] Move InitError, InitWarning, AmountErrMsg (MarcoFalke)
2016-04-19 16:10:57 +02:00
João Barbosa f2d0944eb3 Add lockUnspents option to fundrawtransaction 2016-04-15 15:36:05 +02:00
João Barbosa af4fe7fd12 Add change options to fundrawtransaction 2016-04-15 15:36:05 +02:00
Jonas Schnelli 9f7336b457
[Wallet] slightly refactor GetOldestKeyPoolTime() 2016-04-06 11:06:25 +02:00
MarcoFalke fabbf80f2f [ui] Move InitError, InitWarning, AmountErrMsg 2016-04-02 15:26:21 +02:00
Wladimir J. van der Laan 30c2dd8d05
Merge #7691: [Wallet] refactor wallet/init interaction
25340b7 [Wallet] refactor wallet/init interaction (Jonas Schnelli)
2016-04-02 11:07:39 +02:00
Wladimir J. van der Laan b35a591793
Merge #7558: [RPC] Add import/removeprunedfunds rpc call
f1bb13c Added companion removeprunedfunds call. (instagibbs)
7eb7029 Add importprunedfunds rpc call (instagibbs)
2016-03-29 11:15:02 +02:00
Wladimir J. van der Laan b88e0b0c61
Merge #7506: Use CCoinControl selection in CWallet::FundTransaction
d6cc6a1 Use CCoinControl selection in CWallet::FundTransaction (João Barbosa)
2016-03-24 14:59:51 +01:00
instagibbs f1bb13c93d Added companion removeprunedfunds call. 2016-03-23 10:40:38 -04:00
Wladimir J. van der Laan 3bdc583b3f
Merge #7715: Fix calculation of balances and available coins.
68d4282 Fix calculation of balances and available coins. (Alex Morcos)
2016-03-23 15:09:02 +01:00
João Barbosa bb16c8894b Prevent multiple calls to CWallet::AvailableCoins 2016-03-22 08:43:37 +00:00
Jonas Schnelli 25340b7cd5
[Wallet] refactor wallet/init interaction 2016-03-22 08:20:59 +01:00
Alex Morcos 9e072a6e66 Implement "feefilter" P2P message.
The "feefilter" p2p message is used to inform other nodes of your mempool min fee which is the feerate that any new transaction must meet to be accepted to your mempool.  This will allow them to filter invs to you according to this feerate.
2016-03-21 10:46:25 -04:00
Alex Morcos 68d4282774 Fix calculation of balances and available coins.
No longer consider coins which aren't in our mempool.

Add test for regression in abandonconflict.py
2016-03-18 09:56:30 -04:00
Pieter Wuille c3932b3270 List solvability in listunspent output and improve help 2016-03-14 19:22:11 +01:00
MarcoFalke fa48bb3148 [qt] Remove 0-fee from send dialog 2016-03-14 18:32:09 +01:00
MarcoFalke fa19b18c63 [wallet] Move hardcoded file name out of log messages 2016-03-14 13:54:05 +01:00
Jonas Schnelli 15e6e13624
[Wallet] optimize return value of InitLoadWallet() 2016-03-14 09:33:27 +01:00
Jonas Schnelli fc7c60d699
[Wallet] move "load wallet phase" to CWallet 2016-03-11 14:31:06 +01:00
Wladimir J. van der Laan 86a1ec5b2c
Merge #7576: [Wallet] move wallet help string creation to CWallet
72c2651 [Wallet] move wallet help string creation to CWallet (Jonas Schnelli)
2016-03-11 08:40:37 +01:00
João Barbosa d6cc6a1830 Use CCoinControl selection in CWallet::FundTransaction 2016-03-08 15:14:47 +00:00
Jonas Schnelli 72c2651581
[Wallet] move wallet help string creation to CWallet 2016-03-05 13:27:04 -05:00
Wladimir J. van der Laan 3368895c3b
Merge #7521: Don't resend wallet txs that aren't in our own mempool
5a2b1c0 Don't resend wallet txs that aren't in our own mempool (Alex Morcos)
2016-03-03 15:09:50 +01:00
MarcoFalke fa06ce0949 Fix doxygen comment for payTxFee 2016-02-27 18:14:57 +01:00
Alex Morcos 5a2b1c0c8b Don't resend wallet txs that aren't in our own mempool 2016-02-11 17:34:55 -05:00
Wladimir J. van der Laan 40e7b61835 wallet: Ignore MarkConflict if block hash is not known
If number of conflict confirms cannot be determined, this means
that the block is still unknown or not yet part of the main chain,
for example during a reindex. Do nothing in that case,
instead of crash with an assertion.

Fixes #7234.
2016-02-09 20:38:31 +01:00
Wladimir J. van der Laan d2228384de
Merge #6480: include the chaintip blockindex in the SyncTransaction signal, add signal UpdateTip()
7d0bf0b include the chaintip *blockIndex in the SyncTransaction signal (Jonas Schnelli)
2016-02-04 17:03:09 +01:00
MarcoFalke fa79db2641 Move maxTxFee out of mempool
Also, remove default values in CMerkleTx::AcceptToMemoryPool()
2016-02-02 20:08:51 +01:00
MarcoFalke fa331db68b mempool: Replace maxFeeRate of 10000*minRelayTxFee with maxTxFee 2016-01-30 11:29:22 +01:00
Wladimir J. van der Laan b92ea98503
Merge #7183: Improved readability of ApproximateBestSubset
96efcad Improved readability of sorting for coin selection. (Murch)
2016-01-20 15:55:03 +01:00
Wladimir J. van der Laan be6d5a617d
Merge pull request #7312
d11fc16 [Wallet] Call notification signal when a transaction is abandoned (Jonas Schnelli)
df0e222 Add RPC test for abandoned and conflicted transactions. (Alex Morcos)
01e06d1 Add new rpc call: abandontransaction (Alex Morcos)
9e69717 Make wallet descendant searching more efficient (Alex Morcos)
2016-01-13 15:47:45 +01:00
Jonas Schnelli d11fc1695c [Wallet] Call notification signal when a transaction is abandoned 2016-01-13 08:42:04 -05:00
Alex Morcos 01e06d1fa3 Add new rpc call: abandontransaction
Unconfirmed transactions that are not in your mempool either due to eviction or other means may be unlikely to be mined.  abandontransaction gives the wallet a way to no longer consider as spent the coins that are inputs to such a transaction.  All dependent transactions in the wallet will also be marked as abandoned.
2016-01-13 08:42:04 -05:00
Wladimir J. van der Laan c49551886a
Merge pull request #7296
bebe58b SQUASHME: Fix rpc tests that assumed fallback to minRelayTxFee (Alex Morcos)
e420a1b Add sane fallback for fee estimation (Alex Morcos)
995b9f3 Always respect GetRequiredFee for wallet txs (Alex Morcos)
2016-01-13 11:04:31 +01:00
Alex Morcos 9e69717254 Make wallet descendant searching more efficient 2016-01-07 16:31:12 -05:00
Alex Morcos f61766b37b Make sure conflicted wallet tx's update balances 2016-01-06 17:24:30 -05:00
Murch 96efcadfc0 Improved readability of sorting for coin selection.
Future proofing added lines
2016-01-05 22:03:43 +01:00
Alex Morcos e420a1b15e Add sane fallback for fee estimation
Add new commandline option "-fallbackfee" to use when fee estimation does not have sufficient data.
2016-01-05 13:13:23 -05:00
Alex Morcos 995b9f385b Always respect GetRequiredFee for wallet txs 2016-01-05 13:10:19 -05:00
Wladimir J. van der Laan 605c17844e
Merge pull request #7205
fa71669 [devtools] Use git pretty-format for year parsing (MarcoFalke)
fa24439 Bump copyright headers to 2015 (MarcoFalke)
fa6ad85 [devtools] Rewrite fix-copyright-headers.py (MarcoFalke)
2016-01-05 14:11:40 +01:00
MarcoFalke fa24439ff3 Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
accraze d812daf967 fix logic for error log 2015-12-12 10:45:53 -08:00
accraze c611acc38a wallet: check if tx scriptPubKey is unspendable 2015-12-12 10:33:37 -08:00
accraze b6915b8239 checks for null data transaction before debug.log
CWalletTx::GetAmounts could not find output address for null data transactions, thus issuing an error in debug.log. This change checks to see if the transaction is OP_RETURN before issuing error.

resolves #6142
2015-12-11 18:07:11 -08:00
Wladimir J. van der Laan 00b4b8d1c4
Merge pull request #7154
a3c3ddb [Qt] add InMempool() info to transaction details (Jonas Schnelli)
2015-12-09 10:48:27 +01:00
Murch fc0f52d780 Added a test for the pruning of extraneous inputs after ApproximateBestSet 2015-12-07 20:08:37 +01:00
Murch af9510e037 Moved set reduction to the end of ApproximateBestSubset to reduce performance impact 2015-12-07 17:36:47 +01:00
AlSzacrel 5c03483e26 Coinselection prunes extraneous inputs from ApproximateBestSubset
A further pass over the available inputs has been added to ApproximateBestSubset after a candidate set has been found. It will prune any extraneous inputs in the selected subset, in order to decrease the number of input and the resulting change.
2015-12-06 23:26:45 +01:00
Jonas Schnelli 7d0bf0bb46
include the chaintip *blockIndex in the SyncTransaction signal
- allows reducing of calls to main.cpp for getting the chaintip during transaction syncing
- potentially allows reducing of cs_main locks
2015-12-04 09:18:53 +01:00
MarcoFalke fabd10a9c9 Fix typo in wallet.cpp 2015-12-02 15:21:18 +01:00
Wladimir J. van der Laan 83f06ca937
Merge pull request #6216
db6047d Take the training wheels off anti-fee-sniping (Peter Todd)
2015-12-02 13:56:57 +01:00
Jonas Schnelli a3c3ddbd7b
[Qt] add InMempool() info to transaction details 2015-12-02 08:38:31 +01:00
Wladimir J. van der Laan 9490bd71bd
Merge pull request #7096
ff723da [Qt] improve minimum absolute fee option - Only display the minimum absolute fee control if CoinControl is enabled (Jonas Schnelli)
31b508a [Qt] make use of the nMinimumTotalFee (absolute) in coincontrols fee calculation (Jonas Schnelli)
80462dd [Qt] use ASYMP_UTF8 (≈) whenever we show a fee that is not absolute (Jonas Schnelli)
ecc7c82 Move fPayAtLeastCustomFee function to CC (Pieter Wuille)
2015-12-01 09:59:03 +01:00
Wladimir J. van der Laan 30c2d8c635
Merge pull request #7105
9ac63d6 Keep track of explicit wallet conflicts instead of using mempool (Pieter Wuille)
2015-12-01 09:22:08 +01:00
Pieter Wuille ecc7c82361
Move fPayAtLeastCustomFee function to CC 2015-11-30 14:09:04 +01:00
Pieter Wuille 9ac63d6d30 Keep track of explicit wallet conflicts instead of using mempool 2015-11-29 13:24:02 +01:00
Ryan Havar 4b89f01d72 Default fPayAtLeastCustomFee to false
This allows for much finer control of the transaction fees per kilobyte
as it prevent small transactions using a fee that is more appropriate
for one that is of a kilobyte.

This also allows controlling the fee per kilobyte over rpc such that:

bitcoin-cli settxfee `bitcoin-cli estimatefee 2`

would make sense, while currently it grossly fails often by a factor of x3
2015-11-28 22:51:41 +01:00
MarcoFalke faf93f37fe [trivial] Reuse translation and cleanup DEFAULT_* values
* DEFAULT_DISABLE_SAFEMODE = false
* Use DEFAULT_* constants for extern bools
2015-11-28 19:01:11 +01:00
Luke Dashjr b966aa836a Constrain constant values to a single location in code 2015-11-28 18:47:29 +01:00
Wladimir J. van der Laan e92377fa7f
Merge pull request #6134
e304432 Pass reference to estimateSmartFee and cleanup whitespace (Suhas Daftuar)
56106a3 Expose RPC calls for estimatesmart functions (Alex Morcos)
e93a236 add estimateSmartFee to the unit test (Alex Morcos)
6303051 EstimateSmart functions consider mempool min fee (Alex Morcos)
f22ac4a Increase success threshold for fee estimation to 95% (Alex Morcos)
4fe2823 Change wallet and GUI code to use new smart fee estimation calls. (Alex Morcos)
22eca7d Add smart fee estimation functions (Alex Morcos)
2015-11-27 12:59:37 +01:00
Suhas Daftuar e30443244a Pass reference to estimateSmartFee and cleanup whitespace 2015-11-24 08:53:14 -05:00
Luke Dashjr 3e7c89196c Optimisation: Store transaction list order in memory rather than compute it every need
Huge performance improvement (450%) for zapwallettxes
2015-11-21 01:48:25 +00:00
Alex Morcos 4fe28236c0 Change wallet and GUI code to use new smart fee estimation calls. 2015-11-16 15:33:06 -05:00
Wladimir J. van der Laan 77beab70de
Merge pull request #6163
87cbdb8 Globals: Explicit Consensus::Params arg for main: (Jorge Timón)
2015-11-10 15:32:03 +01:00
Wladimir J. van der Laan 3694b74fa9
Merge pull request #6887
53238ff Clarify what minrelaytxfee does (MarcoFalke)
abd8b76 [qt] Properly display required fee instead of minTxFee (MarcoFalke)
2015-11-05 12:11:11 +01:00
Wladimir J. van der Laan 8a95a18562
Merge pull request #6669
6342a48 Init: Use DEFAULT_TRANSACTION_MINFEE in help message (MarcoFalke)
a9c73a1 [wallet] Add comments for doxygen (MarcoFalke)
6b0e622 [wallet] Refactor to use new MIN_CHANGE (MarcoFalke)
2015-11-04 12:30:50 +01:00
MarcoFalke abd8b768ee [qt] Properly display required fee instead of minTxFee 2015-11-03 08:53:37 +01:00
Jorge Timón 87cbdb8b41 Globals: Explicit Consensus::Params arg for main:
-CheckBlockIndex
-DisconnectTip
-GetTransaction
-InvalidateBlock
-ProcessGetData
-ReadBlockFromDisk
2015-10-30 14:07:30 +01:00
MarcoFalke a9c73a130e [wallet] Add comments for doxygen 2015-10-28 11:15:48 +01:00
MarcoFalke 6b0e622c25 [wallet] Refactor to use new MIN_CHANGE
* Introduce new constant MIN_CHANGE and use it instead of the
hardcoded "CENT"
* Add test case for MIN_CHANGE
* Introduce new constant for -mintxfee default:
  DEFAULT_TRANSACTION_MINFEE = 1000
2015-10-28 10:52:46 +01:00
Matt Corallo d355cf4420 Only call TrimToSize once per reorg/blocks disconnect 2015-10-13 01:39:38 -07:00
Wladimir J. van der Laan 12a7712abd
Merge pull request #5924
835c122 Clean up change computation in CreateTransaction. (Daniel Kraft)
2015-10-01 11:20:08 +02:00
Pieter Wuille 391dff16fe Do not store Merkle branches in the wallet.
Assume that when a wallet transaction has a valid block hash and transaction position
in it, the transaction is actually there. We're already trusting wallet data in a
much more fundamental way anyway.

To prevent backward compatibility issues, a new record is used for storing the
block locator in the wallet. Old wallets will see a wallet file synchronized up
to the genesis block, and rescan automatically.
2015-09-22 18:51:07 +02:00
Wladimir J. van der Laan ddd8d80c63
Merge pull request #6415
d042854 SQUASH "Implement watchonly support in fundrawtransaction" (Matt Corallo)
428a898 SQUASH "Add have-pubkey distinction to ISMINE flags" (Matt Corallo)
6bdb474 Implement watchonly support in fundrawtransaction (Matt Corallo)
f5813bd Add logic to track pubkeys as watch-only, not just scripts (Matt Corallo)
d3354c5 Add have-pubkey distinction to ISMINE flags (Matt Corallo)
5c17059 Update importaddress help to push its use to script-only (Matt Corallo)
a1d7df3 Add importpubkey method to import a watch-only pubkey (Matt Corallo)
907a425 Add p2sh option to importaddress to import redeemScripts (Matt Corallo)
983d2d9 Split up importaddress into helper functions (Matt Corallo)
cfc3dd3 Also remove pay-2-pubkey from watch when adding a priv key (Matt Corallo)
2015-08-14 16:28:37 +02:00
Matt Corallo d04285430d SQUASH "Implement watchonly support in fundrawtransaction" 2015-08-08 09:30:53 -07:00
Wladimir J. van der Laan f18b8ec7cf Make sure LogPrintf strings are line-terminated
Fix the cases where LogPrint[f] was accidentally called without line
terminator, which resulted in concatenated log lines.

(see e.g. #6492)
2015-08-03 17:40:55 +02:00
Jorge Timón 60c8bac77c Includes: Cleanup around net main and wallet
-Move from .h to .cpp: in main, net and wallet
-Remove unnecessary #include "main.h"
-Cleanup some wallet files includes
2015-07-23 21:10:26 +02:00
Jorge Timón 9dd793f499 TRIVIAL: Missing includes 2015-07-23 21:10:22 +02:00
Matt Corallo 6bdb474dc9 Implement watchonly support in fundrawtransaction
Some code and test cases stolen from
Bryan Bishop <bryan@ledgerx.com> (pull #5524).
2015-07-20 16:01:38 -07:00
Matt Corallo cfc3dd3428 Also remove pay-2-pubkey from watch when adding a priv key 2015-07-20 16:01:37 -07:00
Wladimir J. van der Laan 086cb336cd
Merge pull request #6365
5a7304b Move recently introduced CTransAction::IsEquivalentTo to CWalletTx (Wladimir J. van der Laan)
2015-07-06 19:11:14 +02:00
Wladimir J. van der Laan 9546a977d3
Merge pull request #6335
9238ecb Policy: MOVEONLY: 3 functions to policy.o: (Luke Dashjr)
627b9de Policy: MOVEONLY: Create policy/policy.h with some constants (Jorge Timón)
2015-07-06 18:54:20 +02:00
Wladimir J. van der Laan 5a7304b69d Move recently introduced CTransAction::IsEquivalentTo to CWalletTx
CTransAction::IsEquivalentTo was introduced in #5881.
This functionality is only useful to the wallet, and should never have
been added to the primitive transaction type.
2015-07-02 20:57:39 +02:00
Wladimir J. van der Laan 3203a0832a
Merge pull request #5881
5d34e16 Add txn_clone.py test (Tom Harding)
defd2d5 Better txn_doublespend.py test (Tom Harding)
b2b3619 Implement CTransaction::IsEquivalentTo(...) (Tom Harding)
2015-07-02 19:59:50 +02:00
Jonas Schnelli 5496253966 add CReserveScript to allow modular script keeping/returning
- use one CReserveScript per mining thread
2015-07-01 16:06:14 +02:00
Jonas Schnelli 087e65def9 fix GetScriptForMining() CReserveKey::keepKey() issue 2015-06-30 21:45:46 +02:00
Jonas Schnelli d0fc10a844 detach wallet from miner 2015-06-30 21:45:46 +02:00
Jorge Timón 627b9deff4 Policy: MOVEONLY: Create policy/policy.h with some constants 2015-06-26 17:59:07 +02:00
Peter Todd db6047d61b
Take the training wheels off anti-fee-sniping
Now that the off-by-one error w/nLockTime txs issue has been fixed by
87550eef (75a4d512 in the 0.11 branch) we can make the anti-fee-sniping
protection create transactions with nLockTime set such that they're only
valid in the next block, rather than an earlier block.

There was also a concern about poor propagation, however testing with
transactions with nLockTime = GetAdjustedTime()+1 as a proxy for
nLockTime propagation, as well as a few transactions sent the moment
blocks were received, has turned up no detectable issues with
propagation. If you have a block at a given height you certainly have at
least one peer with that block who will accept the transaction. That
peer will certainly have other peers who will accept it, and soon
essentially the whole network has the transaction. In particular, if a
node recives a transaction that it rejects due to the tx being
non-final, it will be accepted again later as it winds its way around
the network.
2015-06-21 23:39:49 -04:00