aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-10-04wallet: update stored witness in AddToWalletSuhas Daftuar
Replace witness-stripped wallet transactions with full transactions; this can happen when upgrading from a pre-segwit wallet to a segwit- aware wallet. Github-Pull: #11225 Rebased-From: d01a9682b126a5f83c7311e652e6e62f2c2e1d20
2017-10-03Verify DBWrapper iterators are taking snapshotsMatt Corallo
The LevelDB docs seem to indicate that an iterator will not take snapshots (even providing instructions on how to do so yourself). In several of the places we use them, we assume snapshots to have been taken. In order to make sure LevelDB doesn't change out from under us (and to prevent the next person who reads the docs from having the same fright I did), verify that snapshots are taken in our tests. Github-Pull: #11422 Rebased-From: bb8376bbc3d96af727444f90e5f60d47105609dc
2017-10-03[script] Unit tests for IsMineJim Posen
Does not test watch-only addresses. Github-Pull: #11116 Rebased-From: 7a1e873b27b790c965d9927ecd465710dc103136
2017-10-03[script] Unit tests for script/standard functionsJim Posen
Github-Pull: #11116 Rebased-From: d7afe2d1577eb3f6775301c81b94a191e0db99d9
2017-10-03Disallow uncompressed pubkeys in bitcoin-tx [multisig] output addsMatt Corallo
Github-Pull: #11377 Rebased-From: 28d4542a0ac77a30a242d0568e580a5b437f53fa
2017-10-03Replace save|restoreWindowGeometry with Qt functionsMeshCollider
Github-Pull: #11335 Rebased-From: 13baf7217bf8394ae02efc376208ae86eac4d0f6
2017-10-03[Qt] Add delay before filtering transactionsLucas Betschart
Fixes 3141 Github-Pull: #11015 Rebased-From: 7b137acedd5e2ff3fe5395a927c546a528b0cac6
2017-10-03Remove custom fee radio groupAndrew Chow
Removes the extraneous custom fee radio group and its single radio button. The radio button is replaced with a label that has the radio button's text. Github-Pull: #11334 Rebased-From: e53fa4a1ca58ef46416c4a96542722601fb75c5a
2017-10-03rpc: make estimatesmartfee argument naming consistent with documentationWladimir J. van der Laan
Github-Pull: #11267 Rebased-From: 5acd82de9ad6df8cab922da66d49b8ff2bd35439
2017-10-03rpc: update cli for estimatefee argument renameWladimir J. van der Laan
The first argument of estimatesmartfee was renamed from nblocks to conf_target in 06bcdb8da64502a64df03f3c89fbc6ccb72cd349. Update the client-side table as well. Github-Pull: #11267 Rebased-From: 24697c40ee6739b812259140042d426c81179977
2017-10-03Fix division by zero in time remainingMeshCollider
Github-Pull: #11237 Rebased-From: 3b69a08c53c2ef738f32c270fdacf1e4ed5a4c97
2017-10-03Stop test_bitcoin-qt touching ~/.bitcoinMeshCollider
Github-Pull: #11210 Rebased-From: dea086f498097d19a2c9acbfc753c9c2d68dbb03
2017-10-03qt: Use IsMine to validate custom change addressChris Moore
(cherry picked from commit c41224dfd51c896341bbf2fa23e160bf5ffe27c3) Github-Pull: #11247 Rebased-From: a1ea1cfbd8d4fc976f0ab2423d395e03ded6eedd
2017-10-03Remove redundant testutil filesMeshCollider
Github-Pull: #11234 Rebased-From: d1138e36208dac87a27f415f39c70377636e93f1
2017-10-03[Qt] Fix display of package name on 'open config file' tooltipDaniel Edgecumbe
Github-Pull: #11198 Rebased-From: 14ccd4d8d1847d64903224562ad3c7eb795b3781
2017-10-03RPC: gettxout: Slightly improve doc and testsJorge Timón
Github-Pull: #10859 Rebased-From: 6d2d2eb49389d70a5db327e133c9c90748f82d5f
2017-10-03Acquire cs_main lock before cs_wallet during wallet initializationRussell Yanofsky
CWallet::MarkConflicted may acquire the cs_main lock after CWalletDB::LoadWallet acquires the cs_wallet lock during wallet initialization. (CWalletDB::LoadWallet calls ReadKeyValue which calls CWallet::LoadToWallet which calls CWallet::MarkConflicted). This is the opposite order that cs_main and cs_wallet locks are acquired in the rest of the code, and so leads to POTENTIAL DEADLOCK DETECTED errors if bitcoin is built with -DDEBUG_LOCKORDER. This commit changes CWallet::LoadWallet (which calls CWalletDB::LoadWallet) to acquire both locks in the standard order. It also fixes some tests that were acquiring wallet and main locks out of order and failed with the new locking in CWallet::LoadWallet. Error was reported by Luke Dashjr <luke-jr@utopios.org> in https://botbot.me/freenode/bitcoin-core-dev/msg/90244330/ Github-Pull: #11126 Rebased-From: de9a1db2ed14e0c75ffd82dc031f7ad30c56d195
2017-10-03rpc: Write authcookie atomicallyWladimir J. van der Laan
Use POSIX rename atomicity at the `bitcoind` side to create a working cookie atomically: - Write `.cookie.tmp`, close file - Rename `.cookie.tmp` to `.cookie` This avoids clients reading invalid/partial cookies as in #11129. Github-Pull: #11131 Rebased-From: 82dd7195e1fb943f9cd45a48188f9678219c0206
2017-10-03Avoid returning a BIP9Stats object with uninitialized valuespracticalswift
Uninitialized data potentially used in `rpc/blockchain.cpp`: ``` static UniValue BIP9SoftForkDesc(const Consensus::Params& consensusParams, Consensus::DeploymentPos id) { ... const ThresholdState thresholdState = VersionBitsTipState(consensusParams, id); ... if (THRESHOLD_STARTED == thresholdState) { UniValue statsUV(UniValue::VOBJ); BIP9Stats statsStruct = VersionBitsTipStatistics(consensusParams, id); statsUV.push_back(Pair("period", statsStruct.period)); statsUV.push_back(Pair("threshold", statsStruct.threshold)); statsUV.push_back(Pair("elapsed", statsStruct.elapsed)); statsUV.push_back(Pair("count", statsStruct.count)); statsUV.push_back(Pair("possible", statsStruct.possible)); rv.push_back(Pair("statistics", statsUV)); } ... return rv; } ``` Github-Pull: #10957 Rebased-From: 3eb53b867153c957529484b5338d27e69de027c1
2017-10-03[wallet] Close DB on error.Karl-Johan Alm
Github-Pull: #11017 Rebased-From: 03bc719a85cb4928cb4b43d0bc4142f72cb01b23
2017-09-15qt: Translations update pre-0.15.0.1Wladimir J. van der Laan
Tree-SHA512: 942fbba8a959ec5430afeecbb663731944fd646fa3b997252e599d835faff12f329d1b70509b161275c3c88845de031357c8317d7f7c801e24be488912cf4035
2017-09-15Fix Qt 0.14.2->0.15.0 segfault if "total at least" is selectedMatt Corallo
A button was removed, so now button(1) is nullptr Github-Pull: #11332 Rebased-From: cdaf3a1f9e93be273ebf3e470dc709828c55476c Tree-SHA512: 0a49bf4e9ab08e5869170c8a212da60c9a6b90c36427d788de384aa4be6d87bb5e00a21edf78eed34f81bbc554b6f15565bb9b493dafcbfe9d6f4664d7424d9d
2017-08-28qt: Translation update pre-rc3v0.15.0rc3Wladimir J. van der Laan
Tree-SHA512: d813ef923d804722bc161cc62e09ee003b386c0abf2d513ede671e9f14ac4c3df749a9f23ddcba9400fcc335dbef6540e47a212dca8ddc0a3d73aee01f098754
2017-08-28Changing -txindex requires -reindex, not -reindex-chainstateMatt Corallo
Github-Pull: #11108 Rebased-From: cd0ea487422028bec1f5df62ab4c57909c2bcc90 Tree-SHA512: 0fbd50b1343eec14301ee9c2fc76e48dcb1610ce1ddbf3cccbd937e2c0d1bbdfc4920fbc05e7e560c424e0ed7367d6ad3595a1bd38dea669bcbd1c838f522d8e
2017-08-28Output a bit more information for fee calculation report.Alex Morcos
Github-Pull: #11145 Rebased-From: 6af49dddeaeec7f134e86d6f8cf839c55870b7ab Tree-SHA512: 7245c6f7ed81cf3913e351ff1df7f74f4be7abe0ae8be312e4862c9875e2943b0b11136bc9999191cdf03468fdac5d41e294bb59b657605c22643b102e37c070
2017-08-28Fix rounding errors in calculation of minimum change sizeAlex Morcos
Github-Pull: #11145 Rebased-From: a54c7b94f8825e9b52fec9066fe7c1d5b6f53482 Tree-SHA512: d9abb9794edbf7e52450c63d183a4f28e9a3621a670b7f21af92407be096363b44a356818f2abbea11c168d123c04852bd0b60f1cd9d423aefbf4ae831f8567d
2017-08-21qt: Update translations pre-rc2Wladimir J. van der Laan
New locales: - bn - bs - de_DE - en_AU - en_US - es_419 - he_IL - id - ja_JP - my - nb_NO - nl_NL - si - te - th Tree-SHA512: af4e9d0107122e3da7da8ee4952e01a731ed04f13e83ed1979ace24d29c437a83cc23453d8f0b2160829df02c2ffbff0ce749083f82c4d4695c69a3c7feeebed
2017-08-21Pass serialization flags and whether to include hex to TxToUnivAndrew Chow
Github-Pull: #11027 Rebased-From: 6bbdafcdc4f9d9e3f9de72ed686c060fb4b8b465 Tree-SHA512: 8ed049a0945c4f56c518aef6d60efebda5cde09ef63d8e472b363821170d71fb4d16414b360824d7537fc7c7b5e5277bbbd092a20899446e97c188ab8df58c1b
2017-08-21Only return hex field once in getrawtransactionAndrew Chow
The hex is already returned in TxToUniv, no need to give it out a second independent time in getrawtransaction itself. Github-Pull: #11027 Rebased-From: e029c6e709d251809aa04edc08f76a077a2443e7 Tree-SHA512: 4f7892431ddb9b59bcc59756890b97a20d046d1d4898f8a80c564223e1cde1c922da403cea4b8ae79d70741d1a9ff337f077043e5bb538cdc4d34fbe09301240
2017-08-21[wallet] Add logging to MarkReserveKeysAsUsedJohn Newbery
Github-Pull: #11044 Rebased-From: 67ceff4039ae038ae16f06128f868a2e8395b59a Tree-SHA512: 850c5b1010c84e164edf24a83ae36e46309b2eb7a67854bad509265ed590ba67d5f743a8416590da6ecca85fe4bda7f20e8c3152e422638eb7898db11a416af7
2017-08-21[wallet] Remove keypool_topup_cleanupsJohn Newbery
Unused function. Mostly reverts c25d90f125d69e33688288eff439eb7be75012e9 c25d90f... was merged as part of PR 11022 but is not required. Github-Pull: #11044 Rebased-From: 1221f60c94971c0f66abe5fdf086087a173bb0ac Tree-SHA512: da229b128bee5f124c009a1a2adfb4fa879366c81789824c426c9ce5209c835888a7e6cfeb1724551320a98cd08406a605372f84487a0d289cd6e02f9ac3ea21
2017-08-21Add length check for CExtKey deserializationJonas Schnelli
Github-Pull: #11081 Rebased-From: 07685d1bc1b0b815c00a68a5b7b335ffa0d4d90d Tree-SHA512: 7f6b9ca6714d059d500531eb842c1c25edfa04ecba0ea1d9a28010fced657c066cea67d2016bbaa9b96c431a05ca9c0dcf2ba301898ecf96a65a4e01aac7fae9
2017-08-21Fix combinerawtransaction RPC help result sectionJonas Nick
Github-Pull: #11083 Rebased-From: f9ca0fe44ec673695e601045630f151a806e000d Tree-SHA512: ef94958d7de11e091db456e253fa4a188b0b0e713149bd568aa2de11a8a3c1585b34bbfb78aaac12f969533f05602ed8b1cd16275429d86a80c36bb594ce6526
2017-08-14remove unused gArgs wrappersMarko Bencun
2017-08-14scripted-diff: stop using the gArgs wrappersMarko Bencun
They were temporary additions to ease the transition. -BEGIN VERIFY SCRIPT- find src/ -name "*.cpp" ! -wholename "src/util.h" ! -wholename "src/util.cpp" | xargs perl -i -pe 's/(?<!\.)(ParseParameters|ReadConfigFile|IsArgSet|(Soft|Force)?(Get|Set)(|Bool|)Arg(s)?)\(/gArgs.\1(/g' -END VERIFY SCRIPT-
2017-08-14Merge #10483: scripted-diff: Use the C++11 keyword nullptr to denote the ↵Wladimir J. van der Laan
pointer literal instead of the macro NULL 90d4d89 scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL (practicalswift) Pull request description: Since C++11 the macro `NULL` may be: * an integer literal with value zero, or * a prvalue of type `std::nullptr_t` By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf With this patch applied there are no `NULL` macro usages left in the repo: ``` $ git grep NULL -- "*.cpp" "*.h" | egrep -v '(/univalue/|/secp256k1/|/leveldb/|_NULL|NULLDUMMY|torcontrol.*NULL|NULL cert)' | wc -l 0 ``` The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR #10483 (scripted, this PR) * `0` → `nullptr` is handled in PR #10645 (manual) Tree-SHA512: 3c395d66f2ad724a8e6fed74b93634de8bfc0c0eafac94e64e5194c939499fefd6e68f047de3083ad0b4eff37df9a8a3a76349aa17d55eabbd8e0412f140a297
2017-08-14Merge #11012: Make sure to clean up mapBlockSource if we've already seen the ↵Wladimir J. van der Laan
block 3f8fa7f Make sure to clean up mapBlockSource if we've already seen the block (Cory Fields) Pull request description: Otherwise we may leave them dangling. Credit TheBlueMatt. Tree-SHA512: 8be77e08ebfc4f5b206d5ee7cfbe87f92c1eb5bc2b412471993658fe210306789aaf0f3d1454c635508a7d8effede2cf5ac144d622b0157b872733d9661d65c3
2017-08-14Merge #11028: Avoid masking of difficulty adjustment errors by checkpointsWladimir J. van der Laan
85c82b5 Avoid masking of difficulty adjustment errors by checkpoints (Pieter Wuille) Pull request description: Currently difficulty adjustment violations are not reported for chains that branch off before the last checkpoint. Change this by moving the checkpoint check after the difficulty check. Tree-SHA512: 33666f2c3459151b28c42041a463779e6df18f61d3dd5b1879a0af4e5b199ef74d1e33e06af68bebfdfb211569ad5fb56556bfebe9d63b5688d910ea211b839a
2017-08-14Merge #11022: Basic keypool topupWladimir J. van der Laan
d34957e [wallet] [tests] Add keypool topup functional test (Jonas Schnelli) 095142d [wallet] keypool mark-used and topup (John Newbery) c25d90f [wallet] Add HasUnusedKeys() helper (John Newbery) f2123e3 [wallet] Cache keyid -> keypool id mappings (John Newbery) 83f1ec3 [wallet] Don't hold cs_LastBlockFile while calling setBestChain (John Newbery) 2376bfc [wallet] [moveonly] Move LoadKeyPool to cpp (Matt Corallo) cab8557 [wallet] [moveonly] Move CAffectedKeysVisitor (Jonas Schnelli) Pull request description: This PR contains the first part of #10882 : - if a key from the keypool is used, mark all keys up to that key as used, and then try to top up the keypool - top up the keypool on startup Notably, it does not stop the node or prevent the best block from advancing if the keypool drops below a threshold (which means that transactions may be missed and funds lost if restoring from an old HD wallet backup). Tree-SHA512: ac681fefeaf7ec2aab2fa1da93d12273ea80bd05eb48d7b3b551ea6e5d975dd97ba7de52b7fba52993823280ac4079cc36cf78a27dac708107ebf8fb6326142b
2017-08-11Merge #10765: Tests: address placement should be deterministic by defaultMarcoFalke
c5ebddd11 Tests: address placement should be deterministic by default (René Nyffenegger) Pull request description: Better version of wrong and closed pull request https://github.com/bitcoin/bitcoin/pull/10764 Tree-SHA512: dfda6ea4a9dd0f4c8b96212ad43a716ff1dddf115cd2712a2a7e42c97fc9494079c746906b39d880a9827c05d2b75c728afd4ca4519ce4d365f0dae0c4aec24c
2017-08-11[RPC] trivial: gettxout no longer shows version of txFelix Weis
Since the switch to a per-txout chainstate db in #10195, the tx version information is no longer stored. Updated `gettxout` rpc help text accordingly.
2017-08-10Avoid masking of difficulty adjustment errors by checkpointsPieter Wuille
Currently difficulty adjustment violations are not reported for chains that branch off before the last checkpoint. Change this by moving the checkpoint check after the difficulty check.
2017-08-10[wallet] keypool mark-used and topupJohn Newbery
This commit adds basic keypool mark-used and topup: - try to topup the keypool on initial load - if a key in the keypool is used, mark all keys before that as used and try to top up
2017-08-09Merge #10835: Rename member field according to the style guideMarcoFalke
4d4fb33fc Rename member field according to the style guide. (Pavel Janík) Pull request description: After #10193, approx. five instances of this warning are printed when compiling with `-Wshadow`: ``` In file included from txmempool.cpp:14: ./reverse_iterator.h:20:22: warning: declaration shadows a field of 'reverse_range<T>' [-Wshadow] reverse_range(T &x) : x(x) {} ^ ./reverse_iterator.h:17:8: note: previous declaration is here T &x; ^ 1 warning generated. ``` Tree-SHA512: 6c07c2ed6f4f232a3a8bdcdd6057040967c74552fd29d80f42e8a453b95baf203c410aa31dccc08ff2e765cbba02b1a282f6ea7804955f09b31ab20ef383792e
2017-08-09qt: Periodic translations updateWladimir J. van der Laan
Tree-SHA512: f967af98ba40908f3ba1286659a7ffedd1319d8d7d5c8d658f266897cb61ea28bace3f20f8ec77b83a69ac311c7e65467e40c3ee8b320a88768afa15e8c802cc
2017-08-09Merge #10963: [bench] Restore format state of cout after printing with ↵MarcoFalke
std::fixed/setprecision fd05132e5 Restore default format state of cout after printing with std::fixed/setprecision (practicalswift) Pull request description: Restore default format state of `std::cout` after printing with `std::fixed`/`std::setprecision`. Tree-SHA512: 445b5b42aff58e2350939e8febc9b4a6fff478616abfe831aec42bee906cefac7a153c93d506407fb213d04dae9c7afbb5bfd344be63ca0f40ae39b331a4144f
2017-08-08Make sure to clean up mapBlockSource if we've already seen the blockCory Fields
Credit TheBlueMatt
2017-08-08Merge #10998: Fix upgrade cancel warningsWladimir J. van der Laan
861f9a2 Skip remainder of init if upgrade is cancelled (Matt Corallo) Pull request description: Based on #10919. Without this, if you cancel upgrade, you get a needless error: ERROR: VerifyDB(): *** irrecoverable inconsistency in block data at Tree-SHA512: aa47665682c6605ada376f1c100ce17cf8c4312427929eb2e75306f2199b47cbcdb4e0d98d5efcfefff03947b2c0fcbd3aab487a4ed14d50607df685c91a03d0
2017-08-08Merge #11002: [wallet] return correct error code from resendwallettransactionWladimir J. van der Laan
055d95f [wallet] return correct error code from resendwallettransaction (John Newbery) Pull request description: New code in #10995 uses `RPC_INVALID_REQUEST`. According to the comment in rpc/protocol.h: ``` // RPC_INVALID_REQUEST is internally mapped to HTTP_BAD_REQUEST (400). // It should not be used for application-layer errors. ``` Change the returned error code to `RPC_WALLET_ERROR` #11000 will need to be updated to test for the correct error code. Tree-SHA512: 0201b3a2091adf17ad301825da5bd29f0ea7e284b5394cbef80483fc293a558acc849f74a0780bb8501acab324fc722e41ae049cffec7afb76884e26df4b809e
2017-08-08Merge #10999: Fix amounts formatting in `decoderawtransaction`Wladimir J. van der Laan
ce07638 doc: Add comment to use ValueFromAmount/AmountFromValue for JSON, not utilmoneystr (Wladimir J. van der Laan) ec05c50 rpc: Use ValueFromAmount instead of FormatMoney in TxToUniv (Wladimir J. van der Laan) 46347ad rpc: Move ValueFromAmount to core_write (Wladimir J. van der Laan) dac3782 doc: Correct AmountFromValue/ValueFromAmount names (Wladimir J. van der Laan) Pull request description: With this, the amounts returned in `decoderawtransaction` will be padded to 8 digits like anywhere else in the API. This is accomplished by using `ValueFromAmount` in `TxToUniv`, instead of `FormatMoney` which it currently (mistakingly) uses. The `FormatMoney` function is only for debugging/logging use! To avoid dependency issues, `ValueFromAmount` is moved to `core_write.cpp`, where it also fits better. I don't move `AmountFromValue` to `core_read.cpp` at the same time, as this would have more impact due to the RPCError dependency there. (n.b.: large number of changed files is solely due to the util_tests JSONs needing update) Tree-SHA512: 10fc2d27d33a77dbcb57aa7eccd4f53110c05d38eb7df6d40f10f14c08fad4274472e93af75aa59fe68ad0720fdf0930f0108124abef518e0dd162b3d2b2b292