Commit graph

2224 commits

Author SHA1 Message Date
Forrest Voight
03cac0bb8e changed CreateNewBlock to return a CBlockTemplate object, which includes per-tx fee and sigop count data 2012-12-19 16:12:58 -05:00
Pieter Wuille
5dfbd4ff68 Convert fRescan argument to importprivkey to bool 2012-12-19 12:23:29 +01:00
Pieter Wuille
0fb9073edd Split off hash.h from util.h 2012-12-18 21:39:29 +01:00
fanquake
f0bf5fb245 Fix two typos in main.h
Break one long comment down into 3 lines so it's readable.
2012-12-17 18:09:53 +08:00
Gavin Andresen
f4445f9982 Upgrading to 0.8: re-use blkNNNN.dat files. 2012-12-16 12:23:59 -05:00
Philip Kaufmann
a8fbbd8fb0 Bitcoin-Qt: comment out unused parameter in addressbookpage 2012-12-15 11:15:19 +01:00
Pieter Wuille
da8c5c9f4e Merge pull request #2087 from gavinandresen/check210000
Checkpoint at first 25-btc-reward block (210,000)
2012-12-13 14:40:22 -08:00
Pieter Wuille
33766c9557 Merge pull request #2096 from 94m3k1n9/fix-time-formats
Change timestamps to use ISO8601 formatting
2012-12-13 14:39:57 -08:00
Wladimir J. van der Laan
07c3f846c2 Merge pull request #2045 from Diapolo/use_message
use new message() function in BitcoinGUI
2012-12-12 21:17:40 -08:00
Philip Kaufmann
50ce5735d6 LevelDB: build_detect_platform fix NATIVE_WINDOWS indentation
- fix some indentation issues
2012-12-12 19:39:00 +01:00
Gavin Andresen
51dc438942 Merge pull request #2080 from mcassano/importprivkey_rescan_false
add rescan bool to importprivkey to control whether to do a rescan after import
2012-12-12 09:34:24 -08:00
Gavin Andresen
278a09a6c6 Merge pull request #2095 from al42and/upnp
OptionsModel now has MapPortUPnP=false if UPNP is not supported
2012-12-12 09:31:24 -08:00
Gavin Andresen
8a7277a578 Merge pull request #2003 from alexanderkjeldaas/documented-locking-part-2
Documented locking part 1+2
2012-12-12 09:27:35 -08:00
Gavin Andresen
d339da70e5 Merge pull request #1825 from roques/bignum2
Bignum2
2012-12-12 09:23:16 -08:00
Gavin Andresen
5bd5d6c45c Merge pull request #1940 from grimd34th/patch-1
Add NATIVE_WINDOWS
2012-12-12 09:20:46 -08:00
Gavin Andresen
095b06cfae Merge pull request #2073 from grimd34th/patch-3
Update src/makefile.mingw
2012-12-12 09:19:26 -08:00
Gavin Andresen
a9e055a1ca Merge pull request #2048 from jgarzik/no-checkpoints
Add "checkpoints" option, to permit disabling of checkpoint logic.
2012-12-12 09:18:00 -08:00
Gavin Andresen
78504bb04f Merge pull request #1861 from jgarzik/coinlock
Add new RPC "lockunspent", to prevent spending of selected outputs
2012-12-12 09:15:43 -08:00
Gavin Andresen
043a8fb98d Merge pull request #2059 from sipa/benchmark
Add -benchmark for reporting block processing times
2012-12-12 09:14:52 -08:00
Gavin Andresen
dbd5bb8039 Merge pull request #2062 from sipa/nocoins
Reconstruct coins/ database when missing
2012-12-12 09:11:36 -08:00
Gavin Andresen
8b83e2fc2e Merge pull request #2074 from sipa/minor
Two minor inconvenience fixes
2012-12-12 09:10:44 -08:00
Richard Schwab
303b0009dc Change timestamps to use ISO8601 formatting 2012-12-12 16:32:22 +01:00
Andrey Alekseenko
6a3aef39e7 OptionsModel now has MapPortUPnP=false if UPNP is not supported 2012-12-12 13:10:02 +04:00
Gavin Andresen
5d32d3f8cd Checkpoint at first 25-btc-reward block (210,000) 2012-12-10 09:53:22 -05:00
Pieter Wuille
622da5df6e Merge pull request #2068 from Diapolo/CheckDiskSpace
some CheckDiskSpace() related changes
2012-12-07 13:33:24 -08:00
Mike Cassano
44051af1a8 add rescan bool to importprivkey to control whether to do a rescan after import 2012-12-06 20:18:17 -06:00
Pieter Wuille
3fb9b99cca Allow lengthy block reconnections to be interrupted
When the coin database is out of date with the block database, the
best block in it is automatically switched to. This reconnection
process can take time, so allow it to be interrupted.

This also stops block connection as soon as shutdown is requested,
leading to a faster shutdown.
2012-12-06 22:04:59 +01:00
Pieter Wuille
c8b2e4426b Update the block file counter in database when using -reindex
This problem is like earth (mostly harmless). After/during a
-reindex, it means the statistics about the last block file
reported in debug.log are always of blk00000.dat instead of the
last file. Apart from that, it means a few more database entries
need to be read when finding a file to append to the first time.
2012-12-06 22:04:58 +01:00
Pieter Wuille
89b7019be8 Reconstruct coins/ from scratch when missing. 2012-12-06 17:00:12 +01:00
Pieter Wuille
d79775a04d Merge pull request #2057 from Diapolo/FlushBlockFile
FlushBlockFile(): check for valid FILE pointer
2012-12-06 01:35:36 -08:00
Wladimir J. van der Laan
25fd38090a Merge pull request #2066 from Diapolo/small_uiint_changes
UI interface changes
2012-12-05 23:30:06 -08:00
Pieter Wuille
cd1391ae4d Merge pull request #2056 from sipa/fix_2052
Fixes for obscure mempool-checkpoint interaction
2012-12-05 14:15:17 -08:00
Pieter Wuille
8a28bb6dee Add -benchmark for reporting block processing times 2012-12-05 23:06:01 +01:00
Pieter Wuille
0ae0712b1c Add GetTimeMicros() for ore accurate benchmarking 2012-12-05 23:06:01 +01:00
Pieter Wuille
a485c1b69e Merge pull request #2063 from Diapolo/CDiskBlockPos
add 2 constructors in CDiskBlockPos to simplify class usage
2012-12-05 14:01:03 -08:00
Philip Kaufmann
fa45c26a0e call CheckDiskSpace() before pre-allocating space
- even if we are allowed to fail pre-allocating, it's better to check
  for sufficient space before calling AllocateFileRange() and if we
  are out of disk space return with error()
- the above change allows us to remove the CheckDiskSpace() check
  in CBlock::AcceptBlock()
2012-12-05 14:39:09 +01:00
grimd34th
679131b235 Update src/makefile.mingw
With MinGW we use .a not .lib
2012-12-04 16:00:47 -05:00
Philip Kaufmann
15d8ff2029 rework ThreadSafeAskFee() / askFee() functions
- remove unused parameter from ThreadSafeAskFee(), which also results in
  the removal of an orphan translation-string
2012-12-04 21:35:41 +01:00
Philip Kaufmann
7f5a1b529b remove unneeded flag from MSG_INFORMATION and fix an indentation 2012-12-04 21:35:40 +01:00
Pieter Wuille
469e606141 Merge pull request #2058 from sipa/atomicreorg
Make SetBestChain() atomic
2012-12-03 15:11:31 -08:00
Philip Kaufmann
50ecd7b689 use new message() function in BitcoinGUI
- use it for displaying URI parsing warnings
- use it for displaying error and information in backup wallet function
  (the information display is new and the error was a warning before)

- cleanup BitcoinGUI::incomingTransaction()
-- use message() + the information icon from message
-- comment out an unused parameter in the function definition and
   declaration
-- move all pre-checks at the beginning of the function
2012-12-03 14:02:02 +01:00
Philip Kaufmann
3675588a30 Bitcoin-Qt: remove obsolete modal flag from GUI APIs
- as we (can) supply the CClientUIInterface::MODAL flag via the style
  parameter, we don't need a separate bool for checking the modality
2012-12-03 13:24:42 +01:00
Wladimir J. van der Laan
7a8dd98863 Merge pull request #2046 from Diapolo/traymenu
split of createTrayIconMenu() from createTrayIcon() in BitcoinGUI
2012-12-03 01:53:18 -08:00
Philip Kaufmann
a8a4b9673e add 2 constructors in CDiskBlockPos to simplify class usage
- add a default-constructor, which simply calls SetNull() and a
  constructor to directly pass nFile and nPos
- change code to use that new constructors
2012-12-03 10:19:17 +01:00
Pieter Wuille
d33a9218ab Make SetBestChain() atomic
In case a reorganisation fails, the internal state could become
inconsistent (memory only). Previously, a cache per block connect
or disconnect action was used, so blocks could not be applied in
a partial way. Extend this to a cache for the entire reorganisation,
making it atomic entirely. This also simplifies the code a bit.
2012-12-02 01:43:35 +01:00
Philip Kaufmann
b19388dd88 FlushBlockFile(): check for valid FILE pointer
- don't call FileCommit() and fclose() if no valid FILE pointer was
  returned by OpenBlockFile()
2012-12-01 11:36:53 +01:00
Pieter Wuille
cd7fb7d1de Merge pull request #2033 from sipa/kickconflicts
Bugfix: remove conflicting transactions from memory pool
2012-11-30 17:10:07 -08:00
Pieter Wuille
8259c57321 Only send reorged txn to mempool after checkpoint 2012-12-01 02:09:41 +01:00
Gavin Andresen
aaef016a07 Merge pull request #2037 from luke-jr/printpriority
Allow -printpriority without -debug
2012-11-30 16:16:59 -08:00
Pieter Wuille
038784b979 Enable script verification for reorganized mempool tx 2012-12-01 00:45:17 +01:00
Pieter Wuille
487db8a2b1 Make test_bitcoin run in a temp datadir 2012-11-29 22:09:16 +01:00
Pieter Wuille
597fa4cd63 Add GetTempPath() to util 2012-11-29 01:00:35 +01:00
Jeff Garzik
e6955d0411 New 'checkpoints' option should default to true. 2012-11-28 12:10:57 -05:00
Jeff Garzik
857b3ad923 Add "checkpoints" option, to permit disabling of checkpoint logic. 2012-11-28 12:07:42 -05:00
Wladimir J. van der Laan
5c37be2db6 Merge pull request #2044 from Diapolo/backupwallet
do not silently ignore errors on "backupwallet" RPC cmd
2012-11-27 23:41:50 -08:00
Philip Kaufmann
f82102121f split of createTrayIconMenu() from createTrayIcon() in BitcoinGUI
- this allows to setup the trayicon before we have and want a trayicon menu
- should be of great use, when we remove that splash screen
- fixes a small bug with the toggleHideAction icon, which is not only used with
  trayicon but also with the Mac dock
2012-11-27 22:20:43 +01:00
Pieter Wuille
0c50d8b007 Merge pull request #2006 from robbak/make-leveldb-macro
Change 'make' to $(MAKE) in leveldb make command line
2012-11-27 12:49:37 -08:00
Philip Kaufmann
ad525e9c8f do not silently ignore errors on "backupwallet" RPC cmd 2012-11-27 16:27:54 +01:00
Luke Dashjr
2646080e3d Allow -printpriority without -debug 2012-11-26 16:30:54 +00:00
Philip Kaufmann
5350ea4171 update CClientUIInterface and remove orphan Wx stuff
- fix ThreadSafeMessageBox always displays error icon
- allow to specify MSG_ERROR / MSG_WARNING or MSG_INFORMATION without a
  custom caption / title
- allow to specify CClientUIInterface::ICON_ERROR / ICON_WARNING and
  ICON_INFORMATION (which is default) as message box icon
- remove CClientUIInterface::OK from ThreadSafeMessageBox-calls, as
  the OK button will be set as default, if none is specified
- prepend "Bitcoin - " to used captions
- rename BitcoinGUI::error() -> BitcoinGUI::message() and add function
  documentation
- change all style parameters and enum flags to unsigned
- update code to use that new API

- update Client- and WalletModel to use new BitcoinGUI::message() and
  rename the classes error() method into message()
- include the possibility to supply the wanted icon for messages from
  Client- and WalletModel via "style" parameter
2012-11-26 13:32:31 +01:00
Pieter Wuille
231b399952 Bugfix: remove conflicting transactions from memory pool
When a transaction A is in the memory pool, while a transaction B
(which shares an input with A) gets accepted into a block, A was
kept forever in the memory pool.

This commit adds a CTxMemPool::removeConflicts method, which
removes transactions that conflict with a given transaction, and
all their children.

This results in less transactions in the memory pool, and faster
construction of new blocks.
2012-11-25 11:50:35 +01:00
Pieter Wuille
3ed1ccb089 Merge pull request #2004 from alexanderkjeldaas/simplify-cmutexlock
Simplify CMutexLock
2012-11-24 13:55:00 -08:00
Pieter Wuille
7818d230a2 Merge pull request #2013 from sipa/blockheader
Split off CBlockHeader from CBlock
2012-11-24 13:54:12 -08:00
burger2
ecd67a1420 Fix duplicate shortcut usage in sign/verify message dialog. 2012-11-22 22:50:30 +01:00
Pieter Wuille
c07a1a6ee4 Merge pull request #1980 from sipa/noreorgsame
Do not reorganize if new branch has same amount of work
2012-11-22 13:33:03 -08:00
Wladimir J. van der Laan
b0e228a4b0 Merge pull request #2024 from Diapolo/fix_qt_crash
Bitcoin-Qt: fix crash on Windows caused by CDBEnv::EnvShutdown()
2012-11-22 02:08:42 -08:00
Gavin Andresen
a91efb2d8d Add assert and comment for subtle pay-to-script-hash logic 2012-11-21 13:58:10 -05:00
Philip Kaufmann
be8e1f8479 Bitcoin-Qt: fix crash on Windows caused by CDBEnv::EnvShutdown()
- can be triggerd by just adding -proxy=crashme with 0.7.1
- crash occured, when AppInit2() was left with return false; after the
  first call to bitdb.open() (Step 6 in init)
- this is caused by GetDataDir() or .string() in CDBEnv::EnvShutdown()
  called via the bitdb global destructor
- init fDbEnvInit and fMockDb to false in CDBEnv::CDBEnv()
2012-11-18 14:10:26 +01:00
Wladimir J. van der Laan
4725e96a3a Merge pull request #2022 from Diapolo/fix_#2018
fix pull #2018
2012-11-17 01:00:20 -08:00
Philip Kaufmann
11406c89fe ConnectBlock(): fix error() format to be unsigned
- I introduced the wrong format macro with my former patch (#2018), this
  needs to be signed not unsigned (thanks Luke-Jr)
2012-11-17 09:57:58 +01:00
Wladimir J. van der Laan
98e7771ca1 Merge pull request #2019 from Diapolo/bitcoinstrings_upd
update bitcoinstrings.cpp and bitcoin_en.ts
2012-11-16 17:29:04 -08:00
Philip Kaufmann
baa510b210 update bitcoinstrings.cpp and bitcoin_en.ts 2012-11-16 19:02:39 +01:00
Gavin Andresen
e45d39f9ee Merge pull request #2009 from sipa/fixmove
Prevent RPC 'move' from deadlocking
2012-11-16 08:09:41 -08:00
Philip Kaufmann
42152c3da9 ensure we use our format macros to avoid compilation warnings
- fixes 2 warnings I observed while compiling on Windows with MinGW
2012-11-16 08:29:47 +01:00
Wladimir J. van der Laan
0c42ee8130 Merge pull request #1767 from Diapolo/RPCCon_clear_history
clear history when using clear button in RPC console
2012-11-15 22:31:12 -08:00
Jeff Garzik
3ef292dc7d Merge pull request #1670 from luke-jr/blksubstr
Use full block hash as unique identifier in debug.log
2012-11-15 18:47:07 -08:00
Jeff Garzik
848c0d5d95 Merge pull request #1945 from centromere/leveldb_fix
Fixed compile error on FreeBSD 9.
2012-11-15 18:31:20 -08:00
Jeff Garzik
34ea321ccd Merge pull request #1987 from jgarzik/no-pw-match
RPC: Forbid RPC username == RPC password
2012-11-15 18:22:50 -08:00
Jeff Garzik
824e196054 Merge pull request #2005 from Diapolo/fixes_main
some small fixes for main.cpp/.h
2012-11-15 18:20:35 -08:00
Jeff Garzik
a0bf93b809 Merge pull request #2012 from luke-jr/invblk_errs
Print error for coinbase-pays-too-much case of ConnectBlock failing
2012-11-15 18:18:55 -08:00
Jeff Garzik
fdbb537d26 Add new RPC "lockunspent", to prevent spending of selected outputs
and associated RPC "listlockunspent".

This is a memory-only filter, which is empty when a node restarts.
2012-11-15 21:11:30 -05:00
Jeff Garzik
7e1610d51e RPC: Forbid RPC username == RPC password
Added security measure.
2012-11-15 20:33:42 -05:00
Pieter Wuille
bb76267cc4 Merge pull request #2010 from Diapolo/bind_unsigned
make enum and parameter used in Bind() unsigned
2012-11-15 15:37:00 -08:00
Pieter Wuille
e754cf4133 Split off CBlockHeader from CBlock
Cleaner and removes the need for the application-specific flags in
serialize.h.
2012-11-16 00:12:33 +01:00
Pieter Wuille
99d0d0f356 Introduce script verification flags
These flags select features to be enabled/disabled during script
evaluation/checking, instead of several booleans passed along.
Currently these flags are defined:
* SCRIPT_VERIFY_P2SH: enable BIP16-style subscript evaluation
* SCRIPT_VERIFY_STRICTENC: enforce strict adherence to pubkey/sig encoding standards.
2012-11-15 23:00:16 +01:00
Luke Dashjr
4ade04ddbd Print error for coinbase-pays-too-much case of ConnectBlock failing 2012-11-14 19:16:56 +00:00
Philip Kaufmann
29e214aaf5 make enum and parameter used in Bind() unsigned
- it's good practise to use unsigned int for enum flags, so change this
  one, as I introduced this for Bind()
2012-11-14 16:13:18 +01:00
Alexander Kjeldaas
bfc9620799 Simplify CMutexLock
o Remove unused Leave and GetLock functions
o Make Enter and TryEnter private.
o Simplify Enter and TryEnter.
  boost::unique_lock doesn't really know whether the
  mutex it wraps is locked or not when the defer_lock
  option is used.
  The boost::recursive_mutex does not expose this
  information, so unique_lock only infers this
  knowledge.  When taking the lock is defered, it
  (randomly) assumes that the lock is not taken.
  boost::unique_lock has the following definition:

        unique_lock(Mutex& m_,defer_lock_t):
            m(&m_),is_locked(false)
        {}

        bool owns_lock() const
        {
            return is_locked;
        }
  Thus it is a mistake to check owns_lock() in Enter
  and TryEnter - they will always return false.
2012-11-14 00:00:23 -03:00
Pieter Wuille
4291e8feab Prevent RPC 'move' from deadlocking
It seemed to create two CWalletDB objects that both grab the
database lock.
2012-11-14 00:31:56 +01:00
Luke Dashjr
c34a32699e Change block references in debug.log to full hash instead of just 0..20 2012-11-13 21:19:58 +00:00
Luke Dashjr
f3a84c3a6b Abstract block hash substr extraction (for debug.log) into BlockHashStr inline 2012-11-13 21:18:32 +00:00
Philip Kaufmann
966a0e8cc9 add CWalletTx::GetImmatureCredit() and use it in CWallet::GetImmatureBalance() 2012-11-13 07:56:48 +01:00
Wladimir J. van der Laan
0d5b1d2a3e Merge pull request #2002 from alexanderkjeldaas/clang-warnings
o Removed verbose clang warning
2012-11-12 22:26:08 -08:00
Robert Backhaus
978770b59d Change 'make' to $(MAKE) in leveldb make command line 2012-11-13 11:45:07 +10:00
Philip Kaufmann
13e5cce4c3 some small fixes for main.cpp/.h
- remove an unwanted ";" at the end of the ~CCoinsView() destructor
- in FindBlockPos() and FindUndoPos() only call fclose(), is file is open
- fix an error string in the CBlockUndo class
2012-11-11 13:16:42 +01:00
Pieter Wuille
e12efb9d33 Merge pull request #1970 from Arnavion/fix-make-leveldb
leveldb cannot compile with custom CFLAGS / CXXFLAGS / LDFLAGS
2012-11-11 03:20:29 -08:00
Pieter Wuille
537c890f24 Merge pull request #1997 from Diapolo/bdb_open
simplify CDBEnv::Open() / fix small glitches
2012-11-11 03:16:52 -08:00
Pieter Wuille
337f876cbb Merge pull request #2000 from Diapolo/fix_indentation
fix some missing indentations in main.cpp for better readability
2012-11-11 02:23:10 -08:00
Alexander Kjeldaas
25511af4a5 o Annotated lock-like functions in net.h.
o Removed unused function EndMessageAbortIfEmpty
2012-11-11 00:55:48 -03:00
Alexander Kjeldaas
05f97d1263 o Added AnnotatedMixin which adds locking annotations to the mutex
API, compatible with clang's -Wthread-safety
2012-11-11 00:55:48 -03:00