Commit graph

208 commits

Author SHA1 Message Date
Pieter Wuille 46784d0826 Merge pull request #1354 from fanquake/master
Update Header Licenses
2012-05-20 12:27:50 -07:00
Wladimir J. van der Laan 239c11d0dd Make testcases build, prevent windows symbol collision 2012-05-20 10:44:50 +02:00
Wladimir J. van der Laan ab1b288fa7 Convert UI interface to boost::signals2.
- Signals now go directly from the core to WalletModel/ClientModel.
  - WalletModel subscribes to signals on CWallet: Prepares for multi-wallet support, by no longer assuming an implicit global wallet.
- Gets rid of noui.cpp, the few lines that were left are merged into init.cpp
- Rename wxXXX message flags to MF_XXX, to make them UI indifferent.
- ThreadSafeMessageBox no longer returns the value `4` which was never used, converted to void.
2012-05-20 10:44:50 +02:00
Wladimir J. van der Laan fe4a655042 Fine-grained UI updates
Gets rid of `MainFrameRepaint` in favor of specific update functions that tell the UI exactly what changed.

This improves the efficiency of various handlers. Also fixes problems with mined transactions not showing up until restart.

The following notifications were added:

- `NotifyBlocksChanged`: Block chain changed
- `NotifyKeyStoreStatusChanged`: Wallet status (encrypted, locked) changed.
- `NotifyAddressBookChanged`: Address book entry changed.
- `NotifyTransactionChanged`: Wallet transaction added, removed or updated.
- `NotifyNumConnectionsChanged`: Number of connections changed.
- `NotifyAlertChanged`: New, updated or cancelled alert. As this finally makes it possible for the UI to know when a new alert arrived, it can be shown as OS notification.

These notifications could also be useful for RPC clients. However, currently, they are ignored in bitcoind (in noui.cpp).

Also brings back polling with timer for numBlocks in ClientModel. This value updates so frequently during initial download that the number of signals clogs the UI thread and causes heavy CPU usage. And after initial block download, the value changes so rarely that a delay of half a second until the UI updates is unnoticable.
2012-05-20 10:41:54 +02:00
Gavin Andresen 973ca019bc Merge pull request #1296 from Diapolo/CheckDiskSpace
make CheckDiskSpace() use 50 * 1024 * 1024 Bytes
2012-05-19 05:48:48 -07:00
Fordy 3a25a2b9b0 Update License in File Headers
I originally created a pull to replace the "COPYING" in crypter.cpp and
crypter.h, but it turned out that COPYING was actually the correct
file.
2012-05-18 22:02:28 +08:00
Jeff Garzik 6d64a0bfed Make orphan logging more verbose, displaying mapOrphanTransactions.size()
Old log message:
	storing orphan tx df2244f6bc

New log message:
	storing orphan tx df2244f6bc (mapsz 51)

Also, trim a few trailing whitespace in main.cpp.
2012-05-17 20:36:55 -04:00
Jeff Garzik cf2f7c30a3 Merge pull request #1295 from jgarzik/txn-retval
[FIX] Always check return values of TxnBegin() and TxnCommit()
2012-05-17 08:49:16 -07:00
Pieter Wuille 385f730f31 Hopefully final fix for the stuck blockchain issue
Immediately issue a "getblocks", instead of a "getdata" (which will
trigger the relevant "inv" to be sent anyway), and only do so when
the previous set of invs led us into a known and attached part of
the block tree.
2012-05-15 17:53:46 +02:00
Philip Kaufmann 966ae00fe4 make CheckDiskSpace() use a global static const uint64 for checking required disk space and remove 2 ugly spaces from a message string 2012-05-14 14:02:36 +02:00
Jeff Garzik 0fb78eae34 Always check return values of TxnBegin() and TxnCommit() 2012-05-14 01:11:11 -04:00
Philip Kaufmann 0985816bf6 ensure that no double timestamps show up in the debug.log, by removing manual timestamps from the source (now only -logtimestamps parameter adds timestamps to debug.log) 2012-05-13 14:36:35 +02:00
Pieter Wuille a3878873f3 Merge pull request #1021 from sipa/ipv6
IPv6 node support
2012-05-11 18:23:56 -07:00
Pieter Wuille 090e5b40f1 Limited relaying/storing of foreign addresses
Introduce a boolean variable for each "network" (ipv4, ipv6, tor, i2p),
and track whether we are likely to able to connect to it. Addresses in
"addr" messages outside of our network get limited relaying and are not
stored in addrman.
2012-05-11 15:29:19 +02:00
Pieter Wuille 23aa78c405 IPv6 node support
This will make bitcoin relay valid routable IPv6 addresses, and when
USE_IPV6 is enabled, listen on IPv6 interfaces and attempt connections
to IPv6 addresses.
2012-05-11 15:29:19 +02:00
Jeff Garzik 33a53bc13b CTxMemPool::accept(): do not log FetchInputs failure redundantly
FetchInputs already logs failures internally.  This commit makes the logging
more consistent with other FetchInputs callsites also.

Prior to this commit, two log lines were logged for one condition:

     ERROR: FetchInputs() : de15fde415 mempool Tx prev not found a2c75da227
     ERROR: CTxMemPool::accept() : FetchInputs failed de15fde415

After this commit, only one line is logged:

     ERROR: FetchInputs() : e0507ab2c7 mempool Tx prev not found 9a620262cd
2012-05-10 20:31:46 -04:00
Jeff Garzik 133dce6a37 CTxMemPool: consolidate two frequently-printed debug.log lines into one
Previously, a single TX would trigger two log lines in quick succession,

        addUnchecked(): size 152
        CTxMemPool::accept() : accepted c4cfdd48b7

After this change, only one log line is used:

        CTxMemPool::accept() : accepted 98885e65db (poolsz 26)
2012-05-10 20:20:31 -04:00
Pieter Wuille f621326c24 Clean up warnings
* Use -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameters
* Remove xCXXFLAGS usage in makefile.unix
* Fix several recent and older sign-compare warnings
2012-05-09 03:48:30 +02:00
Jeff Garzik 203f9e6c00 Merge branch 'tmp-ipv6' into merge-ipv6 2012-05-08 19:43:17 -04:00
Jeff Garzik a2ea797593 Merge pull request #1180 from jgarzik/sign-compare
Fix final sign comparison warnings
2012-05-08 13:50:27 -07:00
Gregory Maxwell 2f1dca645b Merge pull request #841 from sipa/getalltransactions
gettransaction RPC for non-wallet transactions
2012-05-08 13:19:11 -07:00
Gregory Maxwell f1ae31d8af Merge pull request #883 from sipa/loadblock
Add -loadblock to load from an external blk000?.dat file
2012-05-08 12:37:27 -07:00
Pieter Wuille 6860133373 Prevent stuck download: correct solution
Pull request #948 introduced a fix for nodes stuck on a long side branch
of the main chain. The fix was non-functional however, as the additional
getdata request was created in a first step of processing, but dropped
in a second step as it was considered redundant. This commits fixes it
by sending the request directly.
2012-05-06 23:37:45 +02:00
Luke Dashjr 82e6b92b0a Bugfix: %-12I64d is not valid and causes the parameter to be skipped, use %12"PRI64d" instead 2012-05-05 14:24:55 -04:00
Pieter Wuille 39857190de Support for multiple local addresses 2012-05-04 16:12:23 +02:00
Pieter Wuille 478b01d9a7 Add -seednode connections, and use this for -dnsseed + -proxydns 2012-05-04 16:11:54 +02:00
Jeff Garzik 10ab9c2f42 OpenBlockFile(): cast to eliminate signed/unsigned comparison warning
nFile's null value is -1.  Cast that to unsigned int, to avoid warning.

Additionally, avoid nFile==0 because the first valid value is 1.
2012-05-01 17:50:33 -04:00
Gavin Andresen be8651dde7 Check earlier for blocks with duplicate transactions. Fixes #1167 2012-04-30 11:08:07 -04:00
Jeff Garzik 1d8c7a9557 Add casts for unavoidable signed/unsigned comparisons
At these code sites, it is preferable to cast rather than change
a variable's type.
2012-04-23 14:14:36 -04:00
Jeff Garzik c0a0a93d02 Test ScriptSigArgsExpected() for error, before accumulating return value 2012-04-23 14:14:36 -04:00
Jeff Garzik 7bd9c3a3cf SigOp and orphan-tx constants and counts are always unsigned.
Fixes several sign-comparison warnings.
2012-04-23 14:14:03 -04:00
Pieter Wuille 1d740055da -loadblock to load from an external blk000?.dat file 2012-04-22 03:09:35 +02:00
Pieter Wuille c73ba23eb5 gettransaction RPC for non-wallet transactions
Works for wallet transactions, memory-pool transaction and block chain
transactions.

Available for all:
 * txid
 * version
 * locktime
 * size
 * coinbase/inputs/outputs
 * confirmations

Available only for wallet transactions:
 * amount
 * fee
 * details
 * blockindex

Available for wallet transactions and block chain transactions:
 * blockhash
 * time
2012-04-18 23:42:07 +02:00
Pieter Wuille c23617fef3 Merge remote-tracking branch 'jgarzik/mempool' 2012-04-17 20:12:48 +02:00
Pieter Wuille caeddc5d37 Merge pull request #1117 from sipa/deadlockfix
Fix potential deadlock
2012-04-17 11:05:02 -07:00
Pieter Wuille 6b6aaa1698 Further reduce header dependencies
This commit removes the dependency of serialize.h on PROTOCOL_VERSION,
and makes this parameter required instead of implicit. This is much saner,
as it makes the places where changing a version number can have an
influence obvious.
2012-04-17 20:03:42 +02:00
Pieter Wuille ed6d0b5f85 Remove headers.h 2012-04-17 20:00:55 +02:00
Gavin Andresen b97d54355e Merge pull request #1106 from jgarzik/sign-compare
Fix many sign-comparison warnings found in bitcoin codebase
2012-04-17 10:55:56 -07:00
Pieter Wuille c581cc16bb Fix potential deadlock
Conflict:
* cs_main in ProcessMessages() (before calling ProcessMessages)
* cs_vSend in CNode::BeginMessage
versus:
* cs_vSend in ThreadMessageHandler2 (before calling SendMessages)
* cs_main in SendMessages

Even though cs_vSend is a try_lock, if it succeeds simultaneously with
the locking of cs_main in ProcessMessages(), it could cause a deadlock.
2012-04-17 18:50:52 +02:00
Jeff Garzik ce8c93498a main.cpp: replace tabs with spaces
Sometimes they sneak in through the 'vi' door
2012-04-17 12:31:51 -04:00
Jeff Garzik 8bff8ac079 AlreadyHave(): only hold lock during mapTransactions access 2012-04-17 12:30:00 -04:00
Jeff Garzik dd21ce5f1b Merge pull request #1094 from jgarzik/already-have-locking
Locking fix for AlreadyHave()
2012-04-17 09:23:49 -07:00
Jeff Garzik 865a0c1674 Merge pull request #1081 from jgarzik/pong
BIP 0031: pong message
2012-04-17 08:51:17 -07:00
Jeff Garzik c376ac359e Fix loop index var types, fixing many minor sign comparison warnings
foo.size() typically returns an unsigned integral type; make loop variables
match those types' signedness.
2012-04-15 16:52:09 -04:00
Jeff Garzik ca4c4c53a8 CTxMemPool: add helper methods, to reduce global mempool.mapTx accesses 2012-04-15 14:43:19 -04:00
Jeff Garzik d01903e751 CTxMemPool: encapsulate AcceptToMemoryPool 2012-04-15 14:43:19 -04:00
Jeff Garzik 8e45ed66dd CTxMemPool: encapsulate AddToMemoryPoolUnchecked(), RemoveFromMemoryPool(),
and nPooledTx
2012-04-15 14:42:52 -04:00
Jeff Garzik 235507ae48 New class CTxMemPool, encapsulating TX memory pool data members 2012-04-15 14:41:27 -04:00
Wladimir J. van der Laan da7bbd9dfd fix warnings: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] 2012-04-15 13:40:14 +02:00
Jeff Garzik 8deb9822e4 Locking fix for AlreadyHave()
Access to mapTransactions[] must be guarded by cs_mapTransactions lock.

Also, reformat long lines to make the switch statement more readable.
2012-04-13 18:24:55 -04:00