|
|
|
@ -72,6 +72,7 @@ const string strMessageMagic = "Bitcoin Signed Message:\n";
@@ -72,6 +72,7 @@ const string strMessageMagic = "Bitcoin Signed Message:\n";
|
|
|
|
|
|
|
|
|
|
// Internal stuff
|
|
|
|
|
namespace { |
|
|
|
|
|
|
|
|
|
struct CBlockIndexWorkComparator |
|
|
|
|
{ |
|
|
|
|
bool operator()(CBlockIndex *pa, CBlockIndex *pb) { |
|
|
|
@ -120,7 +121,8 @@ namespace {
@@ -120,7 +121,8 @@ namespace {
|
|
|
|
|
}; |
|
|
|
|
map<uint256, pair<NodeId, list<QueuedBlock>::iterator> > mapBlocksInFlight; |
|
|
|
|
map<uint256, pair<NodeId, list<uint256>::iterator> > mapBlocksToDownload; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} // anon namespace
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
@ -130,6 +132,7 @@ namespace {
@@ -130,6 +132,7 @@ namespace {
|
|
|
|
|
// These functions dispatch to one or all registered wallets
|
|
|
|
|
|
|
|
|
|
namespace { |
|
|
|
|
|
|
|
|
|
struct CMainSignals { |
|
|
|
|
// Notifies listeners of updated transaction data (transaction, and optionally the block it is found in.
|
|
|
|
|
boost::signals2::signal<void (const CTransaction &, const CBlock *)> SyncTransaction; |
|
|
|
@ -144,7 +147,8 @@ struct CMainSignals {
@@ -144,7 +147,8 @@ struct CMainSignals {
|
|
|
|
|
// Tells listeners to broadcast their data.
|
|
|
|
|
boost::signals2::signal<void ()> Broadcast; |
|
|
|
|
} g_signals; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} // anon namespace
|
|
|
|
|
|
|
|
|
|
void RegisterWallet(CWalletInterface* pwalletIn) { |
|
|
|
|
g_signals.SyncTransaction.connect(boost::bind(&CWalletInterface::SyncTransaction, pwalletIn, _1, _2)); |
|
|
|
@ -274,7 +278,6 @@ void MarkBlockAsReceived(const uint256 &hash, NodeId nodeFrom = -1) {
@@ -274,7 +278,6 @@ void MarkBlockAsReceived(const uint256 &hash, NodeId nodeFrom = -1) {
|
|
|
|
|
state->nLastBlockReceive = GetTimeMicros(); |
|
|
|
|
mapBlocksInFlight.erase(itInFlight); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Requires cs_main.
|
|
|
|
@ -310,7 +313,7 @@ void MarkBlockAsInFlight(NodeId nodeid, const uint256 &hash) {
@@ -310,7 +313,7 @@ void MarkBlockAsInFlight(NodeId nodeid, const uint256 &hash) {
|
|
|
|
|
mapBlocksInFlight[hash] = std::make_pair(nodeid, it); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} // anon namespace
|
|
|
|
|
|
|
|
|
|
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats) { |
|
|
|
|
LOCK(cs_main); |
|
|
|
|