Alex Morcos
8e69adc665
Add missing include for atomic in db.h
8 years ago
practicalswift
4087d9ea7c
Remove unnecessary forward class declarations in header files
8 years ago
Andrew Chow
c45cbaf69f
Fix stopatheight
...
Moves stopatheight check into the ActivateBestChain loop so that the block height is actually checked and stopped at the appropriate time.
8 years ago
practicalswift
e53a0fa12a
Remove duplicate includes
8 years ago
practicalswift
dce82397c1
Comment out unused constant REJECT_DUST
8 years ago
practicalswift
49de096c2a
Remove unused Boost includes
8 years ago
Gregory Maxwell
bf376eaccc
Return early in IsBanned.
...
I am not aware of any reason that we'd try to stop a ban-list timing
side-channel and the prior code wouldn't be enough if we were.
8 years ago
practicalswift
3289ef4fe1
Remove unused constant MEMPOOL_GD_VERSION
8 years ago
Russell Yanofsky
3ff1fa8c4a
Use override keyword on CCoinsView overrides
8 years ago
Andrew Chow
ac4e438229
Sanity check transaction scripts in DecodeHexTx
...
Make sure that the scripts of decoded transactions are valid scripts.
8 years ago
Andrew Chow
5b75c47784
Add a valid opcode sanity check to CScript
...
Added a function in CScript that checks if the script contains valid opcodes.
Add a test for that function
8 years ago
Pieter Wuille
e945848582
scripted-diff: Use new naming style for insecure_rand* functions
...
-BEGIN VERIFY SCRIPT-
sed -i 's/\<insecure_randbits(/InsecureRandBits(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp
sed -i 's/\<insecure_randbool(/InsecureRandBool(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp
sed -i 's/\<insecure_randrange(/InsecureRandRange(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp
sed -i 's/\<insecure_randbytes(/InsecureRandBytes(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp
sed -i 's/\<insecure_rand256(/InsecureRand256(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp
sed -i 's/\<insecure_rand(/InsecureRand32(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp
sed -i 's/\<seed_insecure_rand(/SeedInsecureRand(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp
-END VERIFY SCRIPT-
8 years ago
practicalswift
0abc58890c
[tests] Remove printf(...)
8 years ago
practicalswift
227ae9b34d
[tests] Use FastRandomContext instead of boost::random::{mt19937,uniform_int_distribution}
8 years ago
Pieter Wuille
2fcd9cc86b
scripted-diff: Use randbits/bool instead of randrange where possible
...
-BEGIN VERIFY SCRIPT-
sed -i 's/insecure_randbits(1)/insecure_randbool()/g' src/test/*_tests.cpp
sed -i 's/insecure_randrange(2)/insecure_randbool()/g' src/test/*_tests.cpp
sed -i 's/insecure_randrange(4)/insecure_randbits(2)/g' src/test/*_tests.cpp
sed -i 's/insecure_randrange(32)/insecure_randbits(5)/g' src/test/*_tests.cpp
sed -i 's/insecure_randrange(256)/insecure_randbits(8)/g' src/test/*_tests.cpp
-END VERIFY SCRIPT-
8 years ago
Pieter Wuille
2ada678521
Use randbits instead of ad-hoc emulation in prevector tests
8 years ago
Pieter Wuille
5f0b04eedc
Replace rand() & ((1 << N) - 1) with randbits(N)
8 years ago
Pieter Wuille
3ecabae363
Replace more rand() % NUM by randranges
8 years ago
Russell Yanofsky
24e44c354d
Don't return stale data from CCoinsViewCache::Cursor()
...
CCoinsViewCache doesn't actually support cursor iteration returning the
current contents of the cache, so raise an error when the cursor method is
called instead of returning a cursor that iterates over stale data.
Also update the gettxoutsetinfo RPC which was relying on the old behavior to be
explicit about which view it is returning data about.
8 years ago
practicalswift
246a02fb14
Use std::unordered_{map,set} (C++11) instead of boost::unordered_{map,set}
8 years ago
Luke Dashjr
c237bd750e
wallet: Update formatting
8 years ago
Luke Dashjr
9cbe8c80ba
wallet: Forbid -salvagewallet, -zapwallettxes, and -upgradewallet with multiple wallets
8 years ago
Luke Dashjr
a2a5f3f0f0
wallet: Base backup filenames on original wallet filename
8 years ago
Luke Dashjr
b823a4c9f6
wallet: Include actual backup filename in recovery warning message
8 years ago
Luke Dashjr
84dcb45017
Bugfix: wallet: Fix warningStr, errorStr argument order
8 years ago
Luke Dashjr
008c360083
Wallet: Move multiwallet sanity checks to CWallet::Verify, and do other checks on all wallets
8 years ago
Luke Dashjr
0f08575be2
Wallet: Support loading multiple wallets if -wallet used more than once
8 years ago
Luke Dashjr
b124cf04ea
Wallet: Replace pwalletMain with a vector of wallet pointers
8 years ago
practicalswift
3fb81a8480
Use list initialization (C++11) for maps/vectors instead of boost::assign::map_list_of/list_of
8 years ago
Matt Corallo
40796e1a9d
Remove references to priority that snuck back in in 870824e9
.
...
The "priority" field should be appropriately marked as a "dummy"
value and noted that it is deprecated and will likely be removed.
8 years ago
Mario Dian
24980a3e40
Make functions in validation.cpp static and pass chainparams
...
Fix bugs as per PR comment
Change bool static to static bool
8 years ago
practicalswift
b083db617a
[trivial] Fix typo: "occurrences" (misspelled as "occurrances")
...
Typo introduced in 000391132608343c66488d62625c714814959bc9:
$ git blame src/coins.cpp | grep occurrances
00039113
(2017-04-25 11:29:29 -0700 89) // deal with the pre-BIP30 occurrances of duplicate coinbase transactions.
8 years ago
Luke Dashjr
9a5a1d7d45
RPC/rawtransaction: createrawtransaction: Check opt_into_rbf when provided with either value
8 years ago
Luke Dashjr
23b0fe34f5
bitcoin-tx: rbfoptin: Avoid touching nSequence if the value is already opting in
8 years ago
Luke Dashjr
b005bf21a7
Introduce MAX_BIP125_RBF_SEQUENCE constant
8 years ago
Jonas Schnelli
575cde4605
[bitcoin-tx] add rbfoptin command
8 years ago
Luke Dashjr
36bcab2356
RPC/Wallet: Add RBF support for fundrawtransaction
8 years ago
Luke Dashjr
891c5eeec2
Wallet: Refactor FundTransaction to accept parameters via CCoinControl
8 years ago
Luke Dashjr
578ec80d4f
RPC: rawtransaction: Add RBF support for createrawtransaction
8 years ago
Luke Dashjr
19b3648bb5
CWalletDB: Store the update counter per wallet
8 years ago
Luke Dashjr
74e8738961
Bugfix: ForceSetArg should replace entr(ies) in mapMultiArgs, not append
8 years ago
Luke Dashjr
23fb9adaea
wallet: Move nAccountingEntryNumber from static/global to CWallet
8 years ago
Luke Dashjr
9d15d5548d
Bugfix: wallet: Increment "update counter" when modifying account stuff
8 years ago
Luke Dashjr
f28eb8020e
Bugfix: wallet: Increment "update counter" only after actually making the applicable db changes to avoid potential races
...
Also does all "update counter" access via IncrementUpdateCounter
8 years ago
Suhas Daftuar
76f74811c4
Add timeout for headers sync
...
At startup, we choose one peer to serve us the headers chain, until
our best header is close to caught up. Disconnect this peer if more
than 15 minutes + 1ms/expected_header passes and our best header
is still more than 1 day away from current time.
8 years ago
Pieter Wuille
efee1db21a
scripted-diff: use insecure_rand256/randrange more
...
-BEGIN VERIFY SCRIPT-
sed -i "s/\<GetRandHash(/insecure_rand256(/" src/test/*_tests.cpp
sed -i "s/\<GetRand(/insecure_randrange(/" src/test/*_tests.cpp src/test/test_bitcoin.cpp
sed -i 's/\<insecure_rand() % \([0-9]\+\)/insecure_randrange(\1)/g' src/test/*_tests.cpp
-END VERIFY SCRIPT-
8 years ago
Pieter Wuille
1119927df0
Add various insecure_rand wrappers for tests
8 years ago
Pieter Wuille
124d13a58c
Merge test_random.h into test_bitcoin.h
8 years ago
Pieter Wuille
90620d66c9
scripted-diff: Rename cuckoo tests' local rand context
...
-BEGIN VERIFY SCRIPT-
sed -i 's/insecure_rand/local_rand_ctx/g' src/test/cuckoocache_tests.cpp
-END VERIFY SCRIPT-
8 years ago
Pieter Wuille
37e864eb9f
Add FastRandomContext::rand256() and ::randbytes()
...
FastRandomContext now provides all functionality that the real Rand* functions
provide.
8 years ago