Commit graph

710 commits

Author SHA1 Message Date
Pieter Wuille 07fd147b9f
Merge #9353: Add data() method to CDataStream (and use it)
5113474 wallet: Use CDataStream.data() (Wladimir J. van der Laan)
e2300ff bench: Use CDataStream.data() (Wladimir J. van der Laan)
adff950 dbwrapper: Use new .data() method of CDataStream (Wladimir J. van der Laan)
a2141e4 streams: Remove special cases for ancient MSVC (Wladimir J. van der Laan)
af4c44c streams: Add data() method to CDataStream (Wladimir J. van der Laan)
2017-01-09 08:47:47 -08:00
Alex Morcos 20449ef09e Don't overpay fee if we have selected new coins that result in a smaller transaction.
On repeated calls to SelectCoins we try to meet the fee necessary for the last transaction, the new fee required might be smaller, so increase our change by the difference if we can.
2017-01-06 10:18:56 -05:00
Alex Morcos 42f5ce4093 Try to reduce change output to make needed fee in CreateTransaction
Once we've picked coins and dummy-signed the transaction to calculate fee, if we don't have sufficient fee, then try to meet the fee by reducing change before resorting to picking new coins.
2017-01-06 10:12:05 -05:00
Pieter Wuille f646275b90
Merge #9138: Improve fee estimation
44b64b9 Fix edge case with stale fee estimates (Alex Morcos)
78ae62d Add clarifying comments to fee estimation (Alex Morcos)
5fe0f47 Add extra logging to processBlock in fee estimation. (Alex Morcos)
dc008c4 Add IsCurrentForFeeEstimatation (Alex Morcos)
ebafdca Pass pointers to existing CTxMemPoolEntries to fee estimation (Alex Morcos)
d825838 Always update fee estimates on new blocks. (Alex Morcos)
6f06b26 rename bool to validFeeEstimate (Alex Morcos)
84f7ab0 Remove member variable hadNoDependencies from CTxMemPoolEntry (Alex Morcos)
60ac00d Don't track transactions at all during IBD. (Alex Morcos)
4df4479 Remove extraneous LogPrint from fee estimation (Alex Morcos)
2017-01-05 14:22:19 -08:00
Pieter Wuille a7d55c9338
Merge #9465: [Wallet] Do not perform ECDSA signing in the fee calculation inner loop.
b3d7b1c Wallet: Do not perform ECDSA in the fee calculation inner loop. (Gregory Maxwell)
2017-01-05 13:37:03 -08:00
Gregory Maxwell b3d7b1cbe7 Wallet: Do not perform ECDSA in the fee calculation inner loop.
Performing signing in the inner loop has terrible performance
 when many passes through are needed to complete the selection.

Signing before the algorithm is complete also gets in the way
 of correctly setting the fee (e.g. preventing over-payment when
 the fee required goes down on the final selection.)

Use of the dummy might overpay on the signatures by a couple bytes
 in uncommon cases where the signatures' DER encoding is smaller
 than the dummy: Who cares?
2017-01-05 18:15:01 +00:00
Wladimir J. van der Laan 9adb4e1a59 rpc: Argument name consistency
The meaning is clear from the context, and we're inconsistent here.
Also save typing when using named arguments.

- `bitcoinaddress` -> `address`
- `bitcoinprivkey` -> `privkey`
- `bitcoinpubkey` -> `pubkey`
2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan 37a166f146 rpc: Named arguments for wallet calls 2017-01-05 11:30:20 +01:00
Pieter Wuille 6dd81169fc Remove SIGCHECK_VERIFICATION_FACTOR 2017-01-04 13:18:49 -08:00
Pieter Wuille 3641141c8f Move tx estimation data out of CCheckPointData 2017-01-04 13:18:49 -08:00
Pieter Wuille a4bac66cca [MOVEONLY] Move progress estimation out of checkpoints 2017-01-04 13:18:49 -08:00
Alex Morcos 84f7ab08d2 Remove member variable hadNoDependencies from CTxMemPoolEntry
Fee estimation can just check its own mapMemPoolTxs to determine the same information.  Note that now fee estimation for block processing must happen before those transactions are removed, but this shoudl be a speedup.
2017-01-04 12:09:33 -05:00
Pieter Wuille ce370c1811 Mark the minconf parameter to move as ignored 2017-01-04 08:48:21 -08:00
Wladimir J. van der Laan d65a13b773
Merge #9396: Updated listsinceblock rpc documentation
3f67972 updated listsinceblock rpc docs (accraze)
2017-01-04 12:47:56 +01:00
Wladimir J. van der Laan 869781c51c
Merge #9283: A few more CTransactionRef optimizations
91335ba Remove unused MakeTransactionRef overloads (Pieter Wuille)
6713f0f Make FillBlock consume txn_available to avoid shared_ptr copies (Pieter Wuille)
62607d7 Convert COrphanTx to keep a CTransactionRef (Pieter Wuille)
c44e4c4 Make AcceptToMemoryPool take CTransactionRef (Pieter Wuille)
2017-01-04 12:23:10 +01:00
Wladimir J. van der Laan c0ddd32bf6
Merge #9450: Increment MIT licence copyright header year on files modified in 2016
27765b6 Increment MIT Licence copyright header year on files modified in 2016 (isle2983)
2017-01-04 12:09:05 +01:00
Pieter Wuille 2a524b8e8f
Merge #8776: Wallet refactoring leading up to multiwallet
5394b39 Wallet: Split main logic from InitLoadWallet into CreateWalletFromFile (Luke Dashjr)
fb0c934 Wallet: Let the interval-flushing thread figure out the filename (Luke Dashjr)
2017-01-03 14:11:11 -08:00
Wladimir J. van der Laan a9d6151802 qt,wallet: Fix a few typos in messages
As reported by [yahoe.001](https://www.transifex.com/user/profile/yahoe.001/).
2017-01-03 15:01:46 +01:00
isle2983 27765b6403 Increment MIT Licence copyright header year on files modified in 2016
Edited via:

$ contrib/devtools/copyright_header.py update .
2016-12-31 11:01:21 -07:00
Jonas Schnelli 9e351c9586
SetMerkleBranch: remove unused code, remove cs_main lock requirement 2016-12-30 10:37:13 +01:00
Matt Corallo 4cd373aea8 Un-expose mapArgs from utils.h 2016-12-24 11:29:33 -05:00
Matt Corallo 0cf86a6678 Introduce (and use) an IsArgSet accessor method 2016-12-23 21:30:16 -05:00
accraze 3f67972654 updated listsinceblock rpc docs
fixes #8758
2016-12-22 09:28:03 -08:00
Pieter Wuille c44e4c467c Make AcceptToMemoryPool take CTransactionRef 2016-12-21 18:18:23 -08:00
Patrick Strateman d63ff6265b Make nWalletDBUpdated atomic to avoid a potential race. 2016-12-21 13:49:48 -08:00
Wladimir J. van der Laan e8cfe1ee2d
Merge #8589: Inline CTxInWitness inside CTxIn
f6fb7ac Move CTxInWitness inside CTxIn (Pieter Wuille)
2016-12-21 14:04:06 +01:00
Wladimir J. van der Laan 38e4887b46
Merge #8717: [WALLET] Addition of ImmatureCreditCached to MarkDirty()
a560378 [WALLET] Addition of ImmatureCreditCached to MarkDirty() (Spencer Lievens)
2016-12-21 11:30:03 +01:00
Wladimir J. van der Laan 5a70572049
Merge #9262: Prefer coins that have fewer ancestors, sanity check txn before ATMP
cee1612 reduce number of lookups in TransactionWithinChainLimit (Gregory Sanders)
af9bedb Test for fix of txn chaining in wallet (Gregory Sanders)
5882c09 CreateTransaction: Don't return success with too-many-ancestor txn (Gregory Sanders)
0b2294a SelectCoinsMinConf: Prefer coins with fewer ancestors (Gregory Sanders)
2016-12-20 13:27:08 +01:00
Wladimir J. van der Laan 3097ea40d7
Merge #9316: [wallet] Disable free transactions when relay is disabled
faf4ca8 [wallet] Disable free transactions when relay is disabled (MarcoFalke)
2016-12-20 11:29:59 +01:00
Wladimir J. van der Laan a336d13a58
Merge #9311: Flush wallet after abandontransaction
0632939 Flush wallet after abandontransaction (Alex Morcos)
2016-12-19 09:43:54 +01:00
Russell Yanofsky 39c77b00e3 Add documentation for CWalletTx::fFromMe member. 2016-12-15 15:14:02 -05:00
Wladimir J. van der Laan 5113474a91 wallet: Use CDataStream.data() 2016-12-15 17:34:59 +01:00
Russell Yanofsky a1fe9446e9 Remove reference to nonexistent "version" wallet transaction mapvalue field
This change removes a mapValue.erase("version") statement which deletes a
mapValue entry that never existed. The statement was mistakenly added in commit
865c3a2383 in 2010 and is harmless but confusing.
2016-12-14 05:41:36 -05:00
Pieter Wuille 57e337d40e
Merge #9290: Make RelayWalletTransaction attempt to AcceptToMemoryPool.
f692fce Make RelayWalletTransaction attempt to AcceptToMemoryPool. (Gregory Maxwell)
2016-12-14 01:28:09 -08:00
Chris Moore 453bda63dd Add 'subtractFeeFromOutputs' option to 'fundrawtransaction'. 2016-12-13 13:36:23 -08:00
Gregory Sanders 5882c099d9 CreateTransaction: Don't return success with too-many-ancestor txn 2016-12-13 09:41:07 -05:00
Gregory Sanders 0b2294a980 SelectCoinsMinConf: Prefer coins with fewer ancestors 2016-12-13 09:41:04 -05:00
Wladimir J. van der Laan 26fe5c98ab
Merge #9326: Update for OpenSSL 1.1 API.
b05b1af Fix qt/paymentrequestplus.cpp for OpenSSL 1.1 API. (Gregory Maxwell)
bae1eef Fix wallet/test/crypto_tests.cpp for OpenSSL 1.1 API. (Gregory Maxwell)
2016-12-13 12:22:30 +01:00
Wladimir J. van der Laan b6abdc77d3
Merge #9302: Return txid even if ATMP fails for new transaction
b3a7410 Return txid even if ATMP fails for new transaction (Pieter Wuille)
2016-12-13 12:15:27 +01:00
Russell Yanofsky 654e0443fb [trivial] Add comment documenting CWalletTx::mapValue 2016-12-12 11:40:00 -05:00
Gregory Maxwell bae1eef752 Fix wallet/test/crypto_tests.cpp for OpenSSL 1.1 API.
This avoids a compile failure on newly installed debian stretch systems.
2016-12-12 08:10:27 +00:00
MarcoFalke faf4ca84e4 [wallet] Disable free transactions when relay is disabled 2016-12-10 17:45:23 +01:00
Alex Morcos 06329393c7 Flush wallet after abandontransaction 2016-12-09 13:36:42 -05:00
Pieter Wuille b3a74100b8 Return txid even if ATMP fails for new transaction 2016-12-08 11:55:32 -08:00
Jonas Schnelli c24a4f5981
[Wallet] Bugfix: FRT: don't terminate when keypool is empty 2016-12-06 13:45:56 +01:00
Gregory Maxwell f692fce8a4 Make RelayWalletTransaction attempt to AcceptToMemoryPool.
This resolves an issue where a wallet transaction which failed to
 relay previously because it couldn't make it into the mempool
 will not try again until restart, even though mempool conditions
 may have changed.

Abandoned and known-conflicted transactions are skipped.

Some concern was expressed that there may be users with many
 unknown conflicts would waste a lot of CPU time trying to
 add them to their memory pools over and over again.  But I am
 doubtful these users exist in any number, if they do exist
 they have worse problems, and they can mitigate any performance
 issue this might have by abandoning the transactions in question.
2016-12-06 08:01:27 +00:00
Gregory Sanders bc7ff8db99 Add option to return non-segwit serialization via rpc 2016-12-05 07:43:22 -05:00
Wladimir J. van der Laan c01f16aaa0
Merge #9165: SendMoney: use already-calculated balance
ea83d00 SendMoney: use already-calculated balance (instagibbs)
2016-12-05 12:47:31 +01:00
Pavel Janík 9de90bb749 Do not shadow variables (gcc set) 2016-12-05 11:41:46 +01:00
Pieter Wuille f6fb7acda4 Move CTxInWitness inside CTxIn 2016-12-04 23:47:12 -08:00
Pieter Wuille 42fd8dee30 Make DecodeHexTx return a CMutableTransaction 2016-12-02 18:28:22 -08:00
Pieter Wuille c3f5673a63 Make CWalletTx store a CTransactionRef instead of inheriting 2016-12-02 18:28:22 -08:00
Matt Corallo 76faa3cdfe Rename the remaining main.{h,cpp} to validation.{h,cpp} 2016-12-02 09:42:51 -08:00
Wladimir J. van der Laan 74ced54b7e
Merge #9204: Clarify CreateTransaction error messages
918b126 fix CreateTransaction error messages (instagibbs)
2016-11-23 08:42:06 +01:00
Wladimir J. van der Laan 5ea5e0401c
Merge #9141: Remove unnecessary calls to CheckFinalTx
4512550 Remove unnecessary calls to CheckFinalTx (Jonas Schnelli)
2016-11-23 07:24:43 +01:00
Wladimir J. van der Laan 40022fe5f2
Merge #9142: Move -salvagewallet, -zap(wtx) to where they belong
2e44893 Move -salvagewallet, -zap(wtx) to where they belong (Jonas Schnelli)
2016-11-23 07:18:24 +01:00
instagibbs 918b126901 fix CreateTransaction error messages 2016-11-22 13:40:57 -05:00
Pieter Wuille 1662b437b3 Make CBlock::vtx a vector of shared_ptr<CTransaction> 2016-11-19 17:51:09 -08:00
MarcoFalke cb2ed300a8
Merge #9155: [trivial] update comments for tx weight
07ede5d update comments for tx weight (Brian Deery)
2016-11-16 11:05:40 +01:00
Pieter Wuille 6eeac6e30d
Merge #9164: [trivial] credit values are CAmount
20c3215 credit values are CAmount (Gregory Sanders)
2016-11-15 09:44:07 -08:00
instagibbs ea83d0098a SendMoney: use already-calculated balance 2016-11-15 11:56:45 -05:00
Gregory Sanders 20c3215a90 credit values are CAmount 2016-11-15 09:19:23 -05:00
Brian Deery 07ede5d711 update comments for tx weight 2016-11-14 00:38:07 -06:00
Jonas Schnelli 4512550fa0
Remove unnecessary calls to CheckFinalTx 2016-11-12 13:50:39 +01:00
Jonas Schnelli 2e44893081
Move -salvagewallet, -zap(wtx) to where they belong 2016-11-12 10:25:34 +01:00
Jonas Schnelli f7345050e9
Make strWalletFile const 2016-11-11 14:32:38 +01:00
Luke Dashjr 5394b3940d Wallet: Split main logic from InitLoadWallet into CreateWalletFromFile 2016-11-11 11:35:49 +00:00
Luke Dashjr fb0c934d1b Wallet: Let the interval-flushing thread figure out the filename 2016-11-11 11:35:49 +00:00
Pavel Janík bdcba6d933 Initialize variable to prevent compiler warning 2016-11-10 08:11:51 +01:00
Pieter Wuille 528472111b Get rid of nType and nVersion
Remove the nType and nVersion as parameters to all serialization methods
and functions. There is only one place where it's read and has an impact
(in CAddress), and even there it does not impact any of the recursively
invoked serializers.

Instead, the few places that need nType or nVersion are changed to read
it directly from the stream object, through GetType() and GetVersion()
methods which are added to all stream classes.
2016-11-07 13:56:27 -08:00
Wladimir J. van der Laan 0b2322b144
Merge #8981: Wshadow: Do not shadow argument with a local variable
ff6639b Do not shadow local variable (Pavel Janík)
2016-11-07 13:44:00 +01:00
Wladimir J. van der Laan d1871da7fe
Merge #9071: Declare wallet.h functions inline
2ca882a Declare wallet.h functions inline (Pieter Wuille)
2016-11-03 10:22:11 +01:00
Pieter Wuille ed0cc50afe
Merge #9036: wallet: Change default confirm target from 2 to 6
0fdf810 wallet: Change default confirm target from 2 to 6 (Wladimir J. van der Laan)
2016-11-02 23:36:27 -07:00
Pieter Wuille 2ca882ad41 Declare wallet.h functions inline 2016-11-02 17:29:16 -07:00
Wladimir J. van der Laan 6a1343f73b
Merge #8977: [Wallet] Refactor wallet/init interaction (Reaccept wtx, flush thread)
cab1da7 [Wallet] Refactor wallet/init interaction (Reaccept wtx, flush thread) (Jonas Schnelli)
2016-11-02 21:37:43 +01:00
Wladimir J. van der Laan a4fd8dff68
Merge #8828: Move CWalletDB::ReorderTransactions to CWallet
86029e7 Move CWalletDB::ReorderTransactions to CWallet (Patrick Strateman)
2016-11-02 15:37:42 +01:00
Wladimir J. van der Laan f8723d2318
Merge #8753: Locked memory manager
444c673 bench: Add benchmark for lockedpool allocation/deallocation (Wladimir J. van der Laan)
6567999 rpc: Add `getmemoryinfo` call (Wladimir J. van der Laan)
4536148 support: Add LockedPool (Wladimir J. van der Laan)
f4d1fc2 wallet: Get rid of LockObject and UnlockObject calls in key.h (Wladimir J. van der Laan)
999e4c9 wallet: Change CCrypter to use vectors with secure allocator (Wladimir J. van der Laan)
2016-11-02 11:16:29 +01:00
matthias 7f61b49de8 Change all instance of 'GMT epoch' to 'Unix epoch' 2016-10-31 01:11:46 +01:00
Patrick Strateman 86029e72c9 Move CWalletDB::ReorderTransactions to CWallet 2016-10-30 02:15:49 -07:00
Wladimir J. van der Laan 0fdf810d26 wallet: Change default confirm target from 2 to 6
Recent discussion (in IRC meetings, and e.g. #8989) has shown a
preference for the default confirm target for smartfees to be 6 instead
of 2, to avoid overpaying fees for questionable gain.

6 is also a compromise between the GUI's pre-#8989 value of 25 and the
bitcoind `-txconfirmtarget` default of 2. These were unified in #8989,
but this has made the (overly expensive) default of 2 as GUI default.
2016-10-28 14:15:46 +02:00
Wladimir J. van der Laan d2143dc937
Merge #8989: [Qt] overhaul smart-fee slider, adjust default confirmation target
cfe77ef [Qt] overhaul smart-fee slider, adjust default confirmation target (Jonas Schnelli)
6f02899 [Qt] Hide nTxConfirmTarget behind WalletModel (Jonas Schnelli)
004168d CoinControl: add option for custom confirmation target (Jonas Schnelli)
2016-10-28 14:14:55 +02:00
Wladimir J. van der Laan 0dcb888266
Merge #9016: Return useful error message on ATMP failure
169bdab Return useful error message on ATMP failure (instagibbs)
2016-10-28 13:49:15 +02:00
Jonas Schnelli 004168dcb7
CoinControl: add option for custom confirmation target 2016-10-28 10:44:30 +02:00
instagibbs 169bdabe14 Return useful error message on ATMP failure 2016-10-26 15:59:33 -04:00
Wladimir J. van der Laan 04c1c15544 rpc: Remove invalid explanation from wallet fee message 2016-10-26 11:57:27 +02:00
Wladimir J. van der Laan 1ae5839ff0 moveonly: move coincontrol to src/wallet 2016-10-21 11:48:18 +02:00
Pavel Janík ff6639b0f5 Do not shadow local variable 2016-10-20 12:31:05 +02:00
Luke Dashjr 7942d31d5f RPC: importmulti: Avoid using boost::variant::operator!=, which is only in newer boost versions 2016-10-20 10:18:05 +00:00
Jonas Schnelli cab1da745b
[Wallet] Refactor wallet/init interaction (Reaccept wtx, flush thread) 2016-10-20 09:22:13 +02:00
Wladimir J. van der Laan f2d705629b
Merge #7551: Add importmulti RPC call
215caba Add consistency check to RPC call importmulti (Pedro Branco)
cb08fdb Add importmulti rpc call (Pedro Branco)
2016-10-20 09:04:32 +02:00
Wladimir J. van der Laan c587577356
Merge #8928: Fix init segfault where InitLoadWallet() calls ATMP before genesis
37aefff Fix init segfault where InitLoadWallet() calls ATMP before genesis (Matt Corallo)
2016-10-19 18:11:15 +02:00
Pedro Branco 215caba4ed Add consistency check to RPC call importmulti 2016-10-19 15:17:42 +01:00
Wladimir J. van der Laan 999e4c91c2 wallet: Change CCrypter to use vectors with secure allocator
Change CCrypter to use vectors with secure allocator instead of buffers
on in the object itself which will end up on the stack. This avoids
having to call LockedPageManager to lock stack memory pages to prevent the
memory from being swapped to disk. This is wasteful.
2016-10-19 16:17:33 +02:00
Pedro Branco cb08fdbf78 Add importmulti rpc call 2016-10-19 15:17:13 +01:00
Jonas Schnelli 69d1c25768
[RPC] Give RPC commands more information about the RPC request 2016-10-19 14:42:08 +02:00
Wladimir J. van der Laan e10af96cf4
Merge #8287: [wallet] Set fLimitFree = true
fa8b02d [rpc] rawtx: Prepare fLimitFree to make it an option (MarcoFalke)
fa28bfa [wallet] Set fLimitFree = true (MarcoFalke)
2016-10-18 21:05:07 +02:00
Wladimir J. van der Laan cdfb7755a6
Merge #8914: Kill insecure_random and associated global state
5eaaa83 Kill insecure_random and associated global state (Wladimir J. van der Laan)
2016-10-18 15:44:57 +02:00
Wladimir J. van der Laan 5eaaa83ac1 Kill insecure_random and associated global state
There are only a few uses of `insecure_random` outside the tests.
This PR replaces uses of insecure_random (and its accompanying global
state) in the core code with an FastRandomContext that is automatically
seeded on creation.

This is meant to be used for inner loops. The FastRandomContext
can be in the outer scope, or the class itself, then rand32() is used
inside the loop. Useful e.g. for pushing addresses in CNode or the fee
rounding, or randomization for coin selection.

As a context is created per purpose, thus it gets rid of
cross-thread unprotected shared usage of a single set of globals, this
should also get rid of the potential race conditions.

- I'd say TxMempool::check is not called enough to warrant using a special
  fast random context, this is switched to GetRand() (open for
  discussion...)

- The use of `insecure_rand` in ConnectThroughProxy has been replaced by
  an atomic integer counter. The only goal here is to have a different
  credentials pair for each connection to go on a different Tor circuit,
  it does not need to be random nor unpredictable.

- To avoid having a FastRandomContext on every CNode, the context is
  passed into PushAddress as appropriate.

There remains an insecure_random for test usage in `test_random.h`.
2016-10-17 13:08:35 +02:00
Pieter Wuille 248f3a76a8 Fix ismine and addwitnessaddress: no uncompressed keys in segwit 2016-10-17 00:34:37 +08:00
Matt Corallo 37aefff5fc Fix init segfault where InitLoadWallet() calls ATMP before genesis 2016-10-15 13:19:16 -04:00
Patrick Strateman e198c521d3 Move key derivation logic from GenerateNewKey to DeriveNewChildKey 2016-09-30 19:11:00 +02:00
Wladimir J. van der Laan 9b94cca41f
Merge #8658: Remove unused statements in serialization
64d9507 [WIP] Remove unused statement in serialization (Pavel Janík)
2016-09-29 15:00:22 +02:00
Wladimir J. van der Laan 14b7b3fb9f
Merge #8814: [wallet, policy] ParameterInteraction: Don't allow 0 fee
fa4bfb4 [wallet, policy] ParameterInteraction: Don't allow 0 fee (MarcoFalke)
2016-09-28 08:09:42 +02:00
Pavel Janík 4731cab8fb Do not shadow variables 2016-09-27 09:25:15 +02:00
MarcoFalke fa4bfb4819 [wallet, policy] ParameterInteraction: Don't allow 0 fee 2016-09-26 14:44:24 +02:00
MarcoFalke faef293cf3 [wallet] Add high transaction fee warnings 2016-09-26 01:11:27 +02:00
Wladimir J. van der Laan 886e8c9b72
Merge #8768: init: Get rid of fDisableWallet
fa58edb [wallet] Introduce DEFAULT_DISABLE_WALLET (MarcoFalke)
fab9107 init: Get rid of fDisableWallet (MarcoFalke)
2016-09-21 12:27:56 +02:00
MarcoFalke fa58edbffe [wallet] Introduce DEFAULT_DISABLE_WALLET 2016-09-21 12:06:58 +02:00
MarcoFalke fab91070d3 init: Get rid of fDisableWallet 2016-09-20 17:32:05 +02:00
Jonas Schnelli c6f5ca822f
[Wallet] remove "unused" ThreadFlushWalletDB from removeprunedfunds 2016-09-20 16:18:24 +02:00
Wladimir J. van der Laan a1f8d3ed95
Merge #8696: [Wallet] Remove last external reference to CWalletDB
2ca6b9d Remove last reference to CWalletDB from accounting_tests.cpp (Patrick Strateman)
02e2a81 Remove pwalletdb parameter from CWallet::AddAccountingEntry (Patrick Strateman)
d2e678d Add CWallet::ReorderTransactions and use in accounting_tests.cpp (Patrick Strateman)
59adc86 Add CWallet::ListAccountCreditDebit (Patrick Strateman)
2016-09-20 12:47:31 +02:00
MarcoFalke faddd62518 init: Get rid of some ENABLE_WALLET 2016-09-19 16:14:18 +02:00
Patrick Strateman 2ca6b9df1d Remove last reference to CWalletDB from accounting_tests.cpp 2016-09-15 13:51:04 -07:00
Patrick Strateman 02e2a81536 Remove pwalletdb parameter from CWallet::AddAccountingEntry 2016-09-15 13:50:59 -07:00
Patrick Strateman d2e678d7d2 Add CWallet::ReorderTransactions and use in accounting_tests.cpp 2016-09-15 06:52:15 -07:00
Patrick Strateman 59adc86680 Add CWallet::ListAccountCreditDebit
Simple pass through for CWalletDB::ListAccountCreditDebit
2016-09-15 06:52:15 -07:00
Spencer Lievens a56037805c [WALLET] Addition of ImmatureCreditCached to MarkDirty()
To protect against possible invalidation and to bring conformity to the code.
2016-09-13 23:30:32 +01:00
Wladimir J. van der Laan fa7caf6d91
Merge #8693: add witness address to address book
62ffbbd add witness address to address book (instagibbs)
2016-09-13 17:10:28 +02:00
Wladimir J. van der Laan 37ac67816a
Merge #8601: Add option to opt into full-RBF when sending funds (rebase, original by petertodd)
86726d8 Rename `-optintofullrbf` option to `-walletrbf` (Wladimir J. van der Laan)
05fa823 wallet: Add BIP125 comment for MAXINT-1/-2 behavior (Wladimir J. van der Laan)
152f45b Add option to opt into full-RBF when sending funds (Peter Todd)
2016-09-13 11:35:26 +02:00
Wladimir J. van der Laan 86726d8680 Rename -optintofullrbf option to -walletrbf
This makes it clear that this is a wallet option.
2016-09-13 11:32:29 +02:00
instagibbs 62ffbbdec3 add witness address to address book 2016-09-09 12:15:08 -04:00
Pavel Janík 64d9507ea5 [WIP] Remove unused statement in serialization 2016-09-09 13:59:34 +02:00
Wladimir J. van der Laan 2abfe5956e
Merge #8664: Fix segwit-related wallet bug
c40b034 Clear witness with vin/vout in CWallet::CreateTransaction() (Suhas Daftuar)
2016-09-09 12:24:39 +02:00
Jeremy Rubin d1a2295f0d Made the ForEachNode* functions in src/net.cpp more pragmatic and self documenting 2016-09-08 13:06:05 -04:00
Cory Fields 53347f0cb9 net: create generic functor accessors and move vNodes to CConnman 2016-09-08 12:24:06 -04:00
Cory Fields 5b446dd5b1 net: Pass CConnection to wallet rather than using the global 2016-09-08 12:04:35 -04:00
Suhas Daftuar c40b034327 Clear witness with vin/vout in CWallet::CreateTransaction() 2016-09-04 20:09:13 -04:00
Wladimir J. van der Laan 6f939c9080
Merge #8629: C++11: s/boost::scoped_ptr/std::unique_ptr/
cdd79eb C++11: s/boost::scoped_ptr/std::unique_ptr/ (Jorge Timón)
2016-09-02 09:56:33 +02:00
Jorge Timón cdd79eb70f C++11: s/boost::scoped_ptr/std::unique_ptr/ 2016-09-01 19:05:07 +02:00
Pavel Janík b175cb755b Do not shadow variables. 2016-08-31 16:16:05 +02:00
Wladimir J. van der Laan 0c8875d23b
Merge #8163: Do not shadow global RPC table variable (tableRPC)
de1bbe3 Do not shadow global RPC table variable (tableRPC) (Pavel Janík)
2016-08-31 16:07:58 +02:00
Alexey Vesnin 323a5fe06a Berkeley DB v6 compatibility fix
Fixes building error looking like this:
CXX wallet/libbitcoin_wallet_a-db.o
wallet/db.cpp: In member function ‘void CDBEnv::EnvShutdown()’:
wallet/db.cpp:46:16: error: call of overloaded ‘DbEnv(int)’ is ambiguous
DbEnv(0).remove(strPath.c_str(), 0);
^
wallet/db.cpp:46:16: note: candidates are:
In file included from wallet/db.h:21:0,
from wallet/db.cpp:6:
/usr/include/db_cxx.h:916:2: note: DbEnv::DbEnv(const DbEnv&)
DbEnv(const DbEnv &);
^
/usr/include/db_cxx.h:518:2: note: DbEnv::DbEnv(DB_ENV)
DbEnv(DB_ENV *dbenv);
^
/usr/include/db_cxx.h:516:2: note: DbEnv::DbEnv(u_int32_t)
DbEnv(u_int32_t flags);
^
Makefile:5780: recipe for target 'wallet/libbitcoin_wallet_a-db.o' failed
make[2]: ** [wallet/libbitcoin_wallet_a-db.o] Error 1
2016-08-30 09:00:55 +03:00
Pieter Wuille 01680195f8
Merge #8564: [Wallet] remove unused code/conditions in ReadAtCursor
beef966 [Wallet] remove unused code/conditions in ReadAtCursor (Jonas Schnelli)
2016-08-29 16:16:23 +02:00
Wladimir J. van der Laan 12892dbb9f
Merge #8590: Remove unused variables
fa6dc9f Remove unused variables (MarcoFalke)
2016-08-26 13:24:12 +02:00
Wladimir J. van der Laan 05fa823bf6 wallet: Add BIP125 comment for MAXINT-1/-2 behavior 2016-08-26 12:57:28 +02:00
Peter Todd 152f45ba58 Add option to opt into full-RBF when sending funds 2016-08-26 12:10:42 +02:00
MarcoFalke fa28bfa341 [wallet] Set fLimitFree = true 2016-08-25 15:27:48 +02:00
Pavel Janík de1bbe3b78 Do not shadow global RPC table variable (tableRPC) 2016-08-25 15:02:26 +02:00
MarcoFalke fa6dc9f0e5 Remove unused variables 2016-08-25 14:59:38 +02:00
MarcoFalke fab5ecb771 [wallet] rpc: Drop misleading option 2016-08-24 19:28:04 +02:00
Wladimir J. van der Laan 21857d2bf7
Merge #8450: [Test] Replace rpc_wallet_tests.cpp with python RPC unit tests
9578333 Remove rpc_wallet_tests.cpp (Patrick Strateman)
25400c4 Account wallet feature RPC tests. (Patrick Strateman)
2016-08-24 12:10:42 +02:00
Wladimir J. van der Laan f9167003d9
Merge #8445: Move CWallet::setKeyPool to private section of CWallet.
8680d3a Move wallet initialization logic from AppInit2 to CWallet::InitLoadWallet (Patrick Strateman)
e86eb71 Move CWallet::setKeyPool to private section of CWallet (Patrick Strateman)
2016-08-24 10:33:16 +02:00
Jonas Schnelli beef966e36
[Wallet] remove unused code/conditions in ReadAtCursor 2016-08-23 15:36:23 +02:00
Wladimir J. van der Laan 41d8e78f94
Merge #8539: CDB: fix debug output
fab2e26 CDB: fix debug output (crowning-)
2016-08-22 16:40:08 +02:00
Wladimir J. van der Laan 37e77c106c
Merge #8554: trivial: remove unused variable
4207630 trivial: remove unused variable (Daniel Kraft)
2016-08-22 10:36:37 +02:00
Wladimir J. van der Laan bb0f763a25
Merge #8558: Add copyright header to wallet_text_fixture.cpp
653bb3d Add copyright header to wallet_text_fixture.cpp (Wladimir J. van der Laan)
2016-08-22 10:32:30 +02:00
Wladimir J. van der Laan a55a018d5f
Merge #8548: [wallet] Use __func__ to get function name for output printing
fa785d1 Use __func__ to get function name for output printing (MarcoFalke)
2016-08-22 09:58:28 +02:00
Wladimir J. van der Laan 653bb3d640 Add copyright header to wallet_text_fixture.cpp
I created the file but forgot to add this header.
2016-08-22 09:24:50 +02:00
Patrick Strateman 8680d3aa80 Move wallet initialization logic from AppInit2 to CWallet::InitLoadWallet 2016-08-20 14:03:47 -07:00
Daniel Kraft 4207630f5a trivial: remove unused variable
Remove the unused variable "blockTmp" in CMerkleTx::SetMerkleBranch.  It
was previously used to read the block from disk if not provided as
argument, but is no longer needed.
2016-08-20 10:28:06 +02:00
MarcoFalke fa785d1211 Use __func__ to get function name for output printing 2016-08-19 18:59:00 +02:00
Jonas Schnelli 2468292a03
Merge #8517: [Qt] show wallet HD state in statusbar
914154f [Qt] add HD enabled/disabled icon to the status bar (Jonas Schnelli)
2016-08-19 18:47:49 +02:00
Jonas Schnelli 56ac046960
Merge #8443: [Wallet] Trivial cleanup of HD wallet changes
7e5d94d [Wallet] Trivial cleanup of HD wallet changes (Jonas Schnelli)
2016-08-19 18:39:19 +02:00
Jonas Schnelli 7e5d94df1f
[Wallet] Trivial cleanup of HD wallet changes 2016-08-19 16:23:37 +02:00
Jonas Schnelli 914154f0cc
[Qt] add HD enabled/disabled icon to the status bar 2016-08-19 09:21:04 +02:00
crowning- fab2e26d20 CDB: fix debug output
It doesn't really help to clear a variable before printing it to the debug log.
2016-08-18 16:52:38 +02:00
Patrick Strateman e86eb71604 Move CWallet::setKeyPool to private section of CWallet 2016-08-17 15:24:57 -07:00
Wladimir J. van der Laan e753eaeb34
Merge #8505: Trivial: Fix typos in various files
1aacfc2 various typos (leijurv)
2016-08-17 12:51:16 +02:00
Wladimir J. van der Laan 1030fa718c
Merge #8128: Net: Turn net structures into dumb storage classes
9e9d644 net: fixup nits (Cory Fields)
8945384 net: Have LookupNumeric return a CService directly (Cory Fields)
21ba407 net: narrow include scope after moving to netaddress (Cory Fields)
21e5b96 net: move CNetAddr/CService/CSubNet out of netbase (Cory Fields)
1017b8a net: Add direct tests for new CSubNet constructors (Cory Fields)
b6c3ff3 net: Split resolving out of CSubNet (Cory Fields)
f96c7c4 net: Split resolving out of CService (Cory Fields)
31d6b1d net: Split resolving out of CNetAddr (Cory Fields)
2016-08-15 13:35:27 +02:00
leijurv 1aacfc2da5
various typos 2016-08-14 07:57:11 -06:00
Jonas Schnelli b3b3c2a562
Reduce cs_main locks during ConnectTip/SyncWithWallets 2016-08-12 14:53:10 +02:00
Patrick Strateman 9578333ec4 Remove rpc_wallet_tests.cpp 2016-08-07 19:30:20 -07:00
Pieter Wuille c7e05b35ab
Merge #8432: Make CWallet::fFileBacked private.
29c2d99 Make CWallet::fFileBacked private. (Patrick Strateman)
2016-08-01 02:12:47 +02:00
Cory Fields 21ba407a73 net: narrow include scope after moving to netaddress
Net functionality is no longer needed for CAddress/CAddrman/etc. now that
CNetAddr/CService/CSubNet are dumb storage classes.
2016-07-31 14:01:44 -04:00
Patrick Strateman 29c2d99bc9 Make CWallet::fFileBacked private. 2016-07-30 11:27:48 -07:00
Patrick Strateman 5723bb44ce Remove unused pwalletdb from CWallet::AddToWallet 2016-07-29 17:04:14 -07:00
Patrick Strateman 867f842f1e Remove CWalletDB* parameter from CWallet::AddToWallet 2016-07-29 17:04:14 -07:00
Patrick Strateman 00f09c920c Split CWallet::AddToWallet into AddToWallet and LoadToWallet.
This removes the fFromLoadWallet flag in AddToWallet.  These were already
effectively two methods.
2016-07-29 17:04:14 -07:00
Jonas Schnelli 2266b43e33
Port from 0.13: Create a new HD seed after encrypting the wallet
Forward-ports two commits from 0.13:
- [0.13] Create a new HD seed after encrypting the wallet
- [Wallet] Add CKeyMetadata record for HDMasterKey(s), factor out HD key generation

Github-Pull: #8389
Rebased-From: f142c11ac634df487cc4bc65a5f1c9a3e3563dd9 de45c065f0648c4c41b57cb492420ceeed29dd11
2016-07-28 13:22:33 +02:00
Wladimir J. van der Laan 4d4970fe53
Merge #8206: [Wallet] Add HD xpriv to dumpwallet
77c912d [Wallet] add HD xpriv to dumpwallet (Jonas Schnelli)
2016-07-27 15:25:34 +02:00
Jonas Schnelli 77c912d21c
[Wallet] add HD xpriv to dumpwallet 2016-07-27 15:19:23 +02:00
Jonas Schnelli b50e1ac298
[Wallet] Correct hdmasterkeyid/masterkeyid name confusion 2016-07-21 21:58:12 +02:00
Patrick Strateman 6523fcaab2 Move SetMinVersion for FEATURE_HD to SetHDMasterKey 2016-07-19 22:30:17 -07:00
Wladimir J. van der Laan 045106b4f1
Merge #8367: [Wallet] Ensure <0.13 clients can't open HD wallets
a4f137f [Wallet] Ensure <0.13 clients can't open HD wallets (Jonas Schnelli)
2016-07-19 12:13:12 +02:00
Jonas Schnelli a4f137f367
[Wallet] Ensure <0.13 clients can't open HD wallets 2016-07-18 22:56:45 +02:00
Suhas Daftuar 2c06bae39e Rename "block cost" to "block weight" 2016-07-18 13:28:26 -04:00
Wladimir J. van der Laan 238300b398
Merge #8323: Add HD keypath to CKeyMetadata, report metadata in validateaddress
7945088 [Wallet] comsetic non-code changes for the HD feature (Jonas Schnelli)
68d7682 [Wallet] ensure CKeyMetadata.hdMasterKeyID will be cleared during SetNull() (Jonas Schnelli)
f708085 [QA] extend wallet-hd test to cover HD metadata (Jonas Schnelli)
986c223 [Wallet] print hd masterkeyid in getwalletinfo (Jonas Schnelli)
b1c7b24 [Wallet] report optional HDKeypath/HDMasterKeyId in validateaddress (Jonas Schnelli)
5b95dd2 [Wallet] extend CKeyMetadata with HD keypath (Jonas Schnelli)
2016-07-18 07:58:33 +02:00
Jonas Schnelli 7945088d41
[Wallet] comsetic non-code changes for the HD feature 2016-07-15 10:34:08 +02:00
Jonas Schnelli 68d7682b9f
[Wallet] ensure CKeyMetadata.hdMasterKeyID will be cleared during SetNull() 2016-07-15 10:33:25 +02:00
Wladimir J. van der Laan bc94b87487
Merge #8324: [Wallet] keep HD seed during salvagewallet
b993671 [Wallet] keep HD seed during salvagewallet (Jonas Schnelli)
2016-07-14 11:37:48 +02:00
Jonas Schnelli b993671921
[Wallet] keep HD seed during salvagewallet 2016-07-09 12:58:03 +02:00
Jonas Schnelli 986c223214
[Wallet] print hd masterkeyid in getwalletinfo 2016-07-09 12:12:36 +02:00
Jonas Schnelli 5b95dd2c25
[Wallet] extend CKeyMetadata with HD keypath 2016-07-09 11:52:17 +02:00
MarcoFalke 477777f250 [rpcwallet] Don't use floating point 2016-07-08 12:01:25 +02:00
Wladimir J. van der Laan 20f3cd75f6 wallet: Revert input selection post-pruning
This reverts PR #4906, "Coinselection prunes extraneous inputs from
ApproximateBestSubset".

Apparently the previous behavior of slightly over-estimating the set of
inputs was useful in cleaning up UTXOs.

See also #7664, #7657, as well as 2016-07-01 discussion on #bitcoin-core-dev IRC.
2016-07-01 13:26:01 +02:00
Wladimir J. van der Laan d612837814
Merge #8149: Segregated witness rebased
f852813 BIP9 parameters for testnet (Johnson Lau)
070dbc4 --- [SEGWIT] begin: deployment --- (Pieter Wuille)
fdb43df [qa] Add GetTransactionSigOpCost unit tests (Jonas Nick)
d846e02 [qa] script_tests: witness tests can specify tx amount (Suhas Daftuar)
330b0f3 [qa] p2p segwit tests (Suhas Daftuar)
4f7ff00 [qa] Add rpc test for segwit (Alex Morcos)
66cca79 [qa] Autogeneration support for witness in script_tests (Pieter Wuille)
06d3805 [qa] Add segwit support to script_tests (Pieter Wuille)
00f46cb [qa] Add transaction tests for segwit (NicolasDorier)
0aa9207 [qa] Witness version 0 signing unit tests (Pieter Wuille)
978e200 --- [SEGWIT] begin: tests --- (Pieter Wuille)
745eb67 [RPC] signrawtransaction can sign P2WSH (NicolasDorier)
f4691ab [RPC] Add wallet support for witness transactions (using P2SH) (Pieter Wuille)
605e847 BIP143: Signing logic (Pieter Wuille)
9757b57 --- [SEGWIT] begin: wallet --- (Pieter Wuille)
af87a67 Do not use compact blocks when segwit is enabled (Pieter Wuille)
6032f69 Add rewind logic to deal with post-fork software updates (Pieter Wuille)
b7dbeb2 [libconsensus] Script verification API with amounts (Thomas Kerin)
2b1f6f9 BIP141: Other consensus critical limits, and BIP145 (Pieter Wuille)
7c4bf77 [RPC] Return witness data in blockchain RPCs (Johnson Lau)
3dd4102 BIP143: Verification logic (Pieter Wuille)
0ef1dd3 Refactor script validation to observe amounts (Pieter Wuille)
b8a9749 BIP144: Handshake and relay (receiver side) (Pieter Wuille)
8b49040 BIP141: Commitment structure and deployment (Pieter Wuille)
449f9b8 BIP141: Witness program (Pieter Wuille)
7030d9e BIP144: Serialization, hashes, relay (sender side) (Pieter Wuille)
ecacfd9 --- [SEGWIT] begin: P2P/node/consensus --- (Pieter Wuille)
2016-06-24 18:07:44 +02:00
Wladimir J. van der Laan a1c92c29fd trivial: capitalize BIP32 in option help
For consistency, BIP32 should be in uppercase in translation message.

Reported by @pryds on Transifex.
2016-06-23 10:44:36 +00:00
Alex Morcos 4f7ff00497 [qa] Add rpc test for segwit
Amended by Pieter Wuille to use multisig 1-of-1 for P2WSH tests, and BIP9
based switchover logic.

Fixes and py3 conversion by Marco Falke.
2016-06-22 15:43:01 +02:00
Pieter Wuille f4691ab3a9 [RPC] Add wallet support for witness transactions (using P2SH)
Includes support for pushkeyhash wit v0 by Alex Morcos.
2016-06-22 15:43:01 +02:00
Pieter Wuille 605e8473a7 BIP143: Signing logic 2016-06-22 15:43:01 +02:00
Pieter Wuille 2b1f6f9ccf BIP141: Other consensus critical limits, and BIP145
Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
2016-06-22 15:43:00 +02:00
Pieter Wuille 7030d9eb47 BIP144: Serialization, hashes, relay (sender side)
Contains refactorings by Eric Lombrozo.
Contains fixup by Nicolas Dorier.
Contains cleanup of CInv::GetCommand by Alex Morcos
2016-06-22 15:42:59 +02:00
Wladimir J. van der Laan a6ddb19bd9
Merge #7687: Stop treating importaddress'ed scripts as change
595b22e Stop treating importaddress'ed scripts as change (Pieter Wuille)
2016-06-20 14:09:49 +02:00
MarcoFalke faa91b12f7 [wallet] tests: Don't use floating point 2016-06-17 13:07:38 +02:00
Wladimir J. van der Laan b67a4726df
Merge #8035: [Wallet] Add simplest BIP32/deterministic key generation implementation
afcd77e Detect -usehd mismatches when wallet.dat already exists (Jonas Schnelli)
17c0131 [Docs] Add release notes and bip update for Bip32/HD wallets (Jonas Schnelli)
c022e5b [Wallet] use constant for bip32 hardened key limit (Jonas Schnelli)
f190251 [Wallet] Add simplest BIP32/deterministic key generation implementation (Jonas Schnelli)
2016-06-14 11:44:22 +02:00
Jonas Schnelli afcd77e179
Detect -usehd mismatches when wallet.dat already exists 2016-06-14 08:56:01 +02:00
Wladimir J. van der Laan d096d22446 build: Get rid of CLIENT_DATE
Putting the build date in the executable is a practice that has no place
in these days, now that deterministic building is increasingly common.

Continues #7732 which did this for the GUI.
2016-06-09 13:34:09 +02:00
Pieter Wuille 77f63a4fcd Fix two warnings for comparison between signed and unsigned 2016-06-08 15:34:18 +02:00
MarcoFalke fa7f4f577c [rpc] fundrawtransaction feeRate: Use BTC/kB
Also introduce UniValueType

UniValueType is a wrapper for UniValue::VType which allows setting
a typeAny flag. This flag indicates the type does not matter.

(Used by RPCTypeCheckObj)
2016-06-07 13:12:57 +02:00
MarcoFalke faf82e8fc8 [rpc] fundrawtransaction: Fix help text and interface 2016-06-06 19:40:35 +02:00
Patrick Strateman 152ab236ea Improve CWallet API with new GetAccountPubkey function.
Remove one more caller that is passing CWalletDB.
2016-06-06 07:02:05 -07:00
Wladimir J. van der Laan 243ac0c75b
Merge #8137: Improve CWallet API with new AccountMove function.
9dfaa1c Improve CWallet API with new AccountMove function. (Patrick Strateman)
2016-06-06 14:59:10 +02:00
Wladimir J. van der Laan 8c1e49ba13
Merge #7967: [RPC] add feerate option to fundrawtransaction
04eaa90 Add more clear interface for CoinControl.h regarding individual feerate (Jonas Schnelli)
3b35e48 [RPC] add feerate option to fundrawtransaction (Jonas Schnelli)
2016-06-03 15:47:48 +02:00
Pieter Wuille f972b04d63
Merge #7825: Prevent multiple calls to ExtractDestination
0bf6f30 Prevent multiple calls to ExtractDestination (Pedro Branco)
2016-06-03 00:45:22 +02:00
Pieter Wuille 595b22e5c0 Stop treating importaddress'ed scripts as change
Before this, if someone imported a scriptPubKey directly (in hex form) using
importaddress, outputs sending to it would be treated as change, as the
corresponding CTxDestination was not added to the address book.

Fix this by trying to detect scriptPubKeys that are in fact convertible to a
CTxDestination and add them anyway. Add a warning to the RPC help to warn
against importing raw non-standard scripts.
2016-06-02 15:53:04 +02:00
Patrick Strateman 9dfaa1cb70 Improve CWallet API with new AccountMove function. 2016-06-02 06:00:59 -07:00
Jonas Schnelli c022e5b15d
[Wallet] use constant for bip32 hardened key limit 2016-06-01 20:29:39 +02:00
Pieter Wuille b89ef13114
Merge #7689: Replace OpenSSL AES with ctaes-based version
723779c build: Enumerate ctaes rather than globbing (Cory Fields)
34ed64a crypter: add tests for crypter (Cory Fields)
0a36b9a crypter: shuffle Makefile so that crypto can be used by the wallet (Cory Fields)
976f9ec crypter: add a BytesToKey clone to replace the use of openssl (Cory Fields)
9049cde crypter: hook up the new aes cbc classes (Cory Fields)
fb96831 crypter: constify encrypt/decrypt (Cory Fields)
1c391a5 crypter: fix the stored initialization vector size (Cory Fields)
daa3841 crypto: add aes cbc tests (Cory Fields)
27a212d crypto: add AES 128/256 CBC classes (Cory Fields)
6bec172 Add ctaes-based constant time AES implementation (Pieter Wuille)
a545127 Squashed 'src/crypto/ctaes/' content from commit cd3c3ac (Pieter Wuille)
2016-06-01 18:22:34 +02:00
Jonas Schnelli f19025106d
[Wallet] Add simplest BIP32/deterministic key generation implementation 2016-05-31 14:47:00 +02:00
Pieter Wuille fa2637a3be Always require OS randomness when generating secret keys 2016-05-29 01:52:17 +02:00
Pieter Wuille f6b7df3155
Merge #8061: [Wallet] Improve Wallet encapsulation
380498a Move BackupWallet to CWallet::BackupWallet (Patrick Strateman)
ecb9741 Move GetAccountBalance from rpcwallet.cpp into CWallet::GetAccountBalance (Patrick Strateman)
2016-05-25 18:08:06 +02:00
MarcoFalke e2bf830bb6
Merge #8038: [qa, doc] Various minor fixes
fa83a5d [qa] wallet: Temporarily disable salvagewallet test (MarcoFalke)
fadd048 [doc] Link to clang-format in the developer notes (MarcoFalke)
fa72f7d [doc] Remove outdated line from listunspent RPC help, fix typo (MarcoFalke)
ac40ed7 Increase timeout waiting for pruned blk00000.dat (error10)
2016-05-17 09:27:25 +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
Cory Fields 34ed64a404 crypter: add tests for crypter
Verify that results correct (match known values), consistent (encrypt->decrypt
matches the original), and compatible with the previous openssl implementation.

Also check that failed encrypts/decrypts fail the exact same way as openssl.
2016-05-13 10:23:04 +02:00
Cory Fields 976f9ec264 crypter: add a BytesToKey clone to replace the use of openssl
BytesToKeySHA512AES should be functionally identical to EVP_BytesToKey, but
drops the dependency on openssl.
2016-05-13 10:23:04 +02:00
Cory Fields 9049cde4d9 crypter: hook up the new aes cbc classes 2016-05-13 10:23:04 +02:00
Cory Fields fb96831c1f crypter: constify encrypt/decrypt
This makes CCrypter easier to pass aroundf for tests
2016-05-13 10:23:04 +02:00
Cory Fields 1c391a5866 crypter: fix the stored initialization vector size
AES IV's are 16bytes, not 32. This was harmless but confusing.

Add WALLET_CRYPTO_IV_SIZE to make its usage explicit.
2016-05-13 10:23:03 +02:00
MarcoFalke fa72f7d99d [doc] Remove outdated line from listunspent RPC help, fix typo 2016-05-10 17:59:02 +02: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
Pedro Branco 0bf6f30262 Prevent multiple calls to ExtractDestination 2016-05-06 10:50:02 +01: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
Wladimir J. van der Laan 187186b0fe
Merge #7905: test: move accounting_tests and rpc_wallet_tests to wallet/test
b30fb42 test: Rename wallet.dat to wallet_test.dat (Wladimir J. van der Laan)
a25a4f5 wallet_ismine.h → script/ismine.h (Wladimir J. van der Laan)
f4eae2d test: Create test fixture for wallet (Wladimir J. van der Laan)
de39c95 test: move accounting_tests and rpc_wallet_tests to wallet/test (Wladimir J. van der Laan)
2016-04-19 10:49:48 +02:00
Wladimir J. van der Laan b30fb42e49 test: Rename wallet.dat to wallet_test.dat
Indicate that the file name is not hardcoded, and a little bit of safety
so that it never nukes the main wallet.

Suggestion by Marco Falke.
2016-04-18 15:17:08 +02:00
Wladimir J. van der Laan a25a4f5b04 wallet_ismine.h → script/ismine.h
Removes conditional dependency of `src/test` on wallet.

Makes multisig and P2SH tests complete without wallet built-in.
2016-04-18 15:14:36 +02:00
Wladimir J. van der Laan f4eae2d910 test: Create test fixture for wallet
Removes all the `#ifdef ENABLE_WALLET` from `test_bitcoin` by
making the wallet tests use their own fixture.
2016-04-18 14:57:42 +02:00
Wladimir J. van der Laan d289950180
Merge #7900: fix spelling mistake
3107c47 fix spelling mistake (Chris Moore)
2016-04-18 14:15:12 +02:00
Wladimir J. van der Laan de39c95c24 test: move accounting_tests and rpc_wallet_tests to wallet/test
Move the two other wallet tests to where they belong.
2016-04-18 14:04:40 +02:00
Chris Moore 3107c475a7 fix spelling mistake 2016-04-17 00:01:49 -07:00
Chris Moore dc0693f637 add missing newline
Without the newline I see "bein" where the two lines are concatenated:

Note that all inputs selected must be of standard form and P2SH scripts must *bein* the wallet using importaddress or addmultisigaddress (to calculate fees).
2016-04-16 13:42:28 -07: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
Wladimir J. van der Laan 430fffefaa
Merge #7812: Tiny refactor of IsRBFOptIn, avoid exception
4f7c959 Refactor IsRBFOptIn, avoid exception (Jonas Schnelli)
2016-04-14 16:35:02 +02:00
Jonas Schnelli 9f7336b457
[Wallet] slightly refactor GetOldestKeyPoolTime() 2016-04-06 11:06:25 +02:00
Jonas Schnelli 4f7c959af1
Refactor IsRBFOptIn, avoid exception 2016-04-06 10:59:03 +02:00
MarcoFalke fada0c422c [doc] Fix doxygen comments for members 2016-04-03 11:58:01 +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 fb8a8cf2e6 rpc: Register calls where they are defined
Split out methods to every module, apart from 'help' and 'stop' which
are implemented in rpcserver.cpp itself.

- This makes it easier to add or remove RPC commands - no longer everything that includes
    rpcserver.h has to be rebuilt when there's a change there.
- Cleans up `rpc/server.h` by getting rid of the huge cluttered list of function definitions.
- Removes most of the bitcoin-specific code from rpcserver.cpp and .h.

Continues #7307 for the non-wallet.
2016-03-31 10:48:32 +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
Jonas Schnelli cef8bdf5d7
[Wallet][RPC] add missing abandon status documentation 2016-03-29 08:43:08 +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
João Barbosa df9e9233dc Fix lockunspents help message 2016-03-23 15:44:41 +00:00
Jonas Schnelli 263de3d1c8
[Wallet][RPC] add abandoned status to listtransactions 2016-03-23 15:49:53 +01:00
instagibbs f1bb13c93d Added companion removeprunedfunds call. 2016-03-23 10:40:38 -04:00
instagibbs 7eb702954e Add importprunedfunds rpc 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
Denis Lukianov c5825d2d73 Correct importaddress help reference to importpubkey 2016-03-21 03:16:19 +00: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
Wladimir J. van der Laan e5121eb951
Merge #7617: [doc/log] Fix markdown syntax and line terminate LogPrint
fa26652 Make sure LogPrintf strings are line-terminated (MarcoFalke)
fa97f95 [doc] Fix markdown (MarcoFalke)
fa06ce0 Fix doxygen comment for payTxFee (MarcoFalke)
2016-03-01 18:39:21 +01:00
Wladimir J. van der Laan 78e81b0bc5
Merge #7537: wallet: Warn on unexpected EOF while salvaging wallet
ca8fb59 wallet: Warn on unexpected EOF while salvaging wallet (Wladimir J. van der Laan)
2016-02-29 10:05:07 +01:00
MarcoFalke fa06ce0949 Fix doxygen comment for payTxFee 2016-02-27 18:14:57 +01:00
Matthew Zipkin 7eef1d0dad Clarify description of blockindex
see issues:

https://github.com/bitcoin-dot-org/bitcoin.org/issues/1237

https://github.com/bitcoin/bitcoin/issues/7532
2016-02-18 12:42:59 -08:00
Wladimir J. van der Laan f31b6b8995 test: test leading space for ParseHex
BerkeleyDB dump files have key and value lines indented.
The salvage code passes these to ParseHex as-is.
Check this in the tests (should just pass with current code).
2016-02-15 17:14:30 +01:00
Wladimir J. van der Laan ca8fb59ae1 wallet: Warn on unexpected EOF while salvaging wallet
Check for EOF before every getline, and warn when reading gets to EOF
before the end of the data.

Stricter error checking could shed more light on issues such as #7463
and #7379.
2016-02-15 16:35:12 +01:00
instagibbs c372572595 Fix and cleanup listreceivedbyX documentation 2016-02-12 14:06:59 -05: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 fad6244879 ATMP: make nAbsurdFee const 2016-02-03 13:14:23 +01:00
MarcoFalke fa762d0f00 [wallet.h] Remove main.h include 2016-02-03 12:44:43 +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 62f2d769e4
Merge #7348: MOVE ONLY: move rpc* to rpc/
d13f65e rpc: update inline comments to refer to new file paths (Daniel Cousens)
a0eaff8 move rpc* to rpc/ (Daniel Cousens)
2016-01-28 11:28:24 +01:00
Wladimir J. van der Laan fc08994000
Merge #7262: Reduce inefficiency of GetAccountAddress()
2409865 Reduce inefficiency of GetAccountAddress() (Chris Moore)
2016-01-22 15:31:11 +01:00
Daniel Cousens d13f65ebac rpc: update inline comments to refer to new file paths 2016-01-21 08:39:04 +11:00
Daniel Cousens a0eaff8a1d move rpc* to rpc/ 2016-01-21 08:36:55 +11: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 9982710e88
Merge #7307: [RPC, Wallet] Move RPC dispatch table registration to wallet/ code
dd2dc40 [RPC, Wallet] Move RPC dispatch table registration to wallet/ code (Jonas Schnelli)
2016-01-20 15:15:51 +01:00
Jonas Schnelli dd2dc400ee
[RPC, Wallet] Move RPC dispatch table registration to wallet/ code
Allow extending the rpc dispatch table by appending commands when server is not running.
2016-01-20 15:03:25 +01:00
Wladimir J. van der Laan 82429d0861
Merge #7222: RPC: Indicate which transactions are signaling opt-in RBF
eaa8d27 RPC: indicate which transactions are replaceable (Suhas Daftuar)
2016-01-20 13:50:37 +01:00
MarcoFalke fa6d4cc095 [walletdb] Fix syntax error in key parser 2016-01-20 09:44:53 +01:00
Suhas Daftuar eaa8d2754b RPC: indicate which transactions are replaceable
Add "bip125-replaceable" output field to listtransactions and gettransaction
which indicates if an unconfirmed transaction, or any unconfirmed parent, is
signaling opt-in RBF according to BIP 125.
2016-01-19 08:30:04 -05:00
Wladimir J. van der Laan a8bd616fea
Merge pull request #7329
9d263bd Typo fixes in comments (Chris Wheeler)
2016-01-18 10:41:32 +01:00
Chris Wheeler 9d263bd17c Typo fixes in comments 2016-01-17 11:03:56 +00:00
Wladimir J. van der Laan fd9356ba4e
Merge pull request #7322
c0cf48d c++11: add scoped enum fallbacks to CPPFLAGS rather than defining them locally (Cory Fields)
2016-01-16 10:49:46 +01:00
Wladimir J. van der Laan 17ef279304
Merge pull request #7332
faf671b [wallet] Clarify rpc help message with regard to rounding (MarcoFalke)
2016-01-13 16:01:28 +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