aboutsummaryrefslogtreecommitdiff
path: root/src/zmq/zmqpublishnotifier.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-09-30 11:07:54 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2015-09-30 11:08:30 +0200
commit4f44530bc38fb8367c2b9bde21492b545e7f7f26 (patch)
tree53145a92262745270cfda20578a317e24a749973 /src/zmq/zmqpublishnotifier.cpp
parent3f74cd2361b9f72a91d21f87980e15f2b5b5ca9f (diff)
parentd76a8acb9b7bcabf43e3e05168a36911f187818d (diff)
downloadbitcoin-4f44530bc38fb8367c2b9bde21492b545e7f7f26.tar.xz
Merge pull request #6680
d76a8ac use CBlockIndex* insted of uint256 for UpdatedBlockTip signal (Jonas Schnelli)
Diffstat (limited to 'src/zmq/zmqpublishnotifier.cpp')
-rw-r--r--src/zmq/zmqpublishnotifier.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/zmq/zmqpublishnotifier.cpp b/src/zmq/zmqpublishnotifier.cpp
index 0a6d7d0dbc..4c3eb8f2d9 100644
--- a/src/zmq/zmqpublishnotifier.cpp
+++ b/src/zmq/zmqpublishnotifier.cpp
@@ -116,8 +116,9 @@ void CZMQAbstractPublishNotifier::Shutdown()
psocket = 0;
}
-bool CZMQPublishHashBlockNotifier::NotifyBlock(const uint256 &hash)
+bool CZMQPublishHashBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
{
+ uint256 hash = pindex->GetBlockHash();
LogPrint("zmq", "Publish hash block %s\n", hash.GetHex());
char data[32];
for (unsigned int i = 0; i < 32; i++)
@@ -137,18 +138,15 @@ bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &t
return rc == 0;
}
-bool CZMQPublishRawBlockNotifier::NotifyBlock(const uint256 &hash)
+bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
{
- LogPrint("zmq", "Publish raw block %s\n", hash.GetHex());
+ LogPrint("zmq", "Publish raw block %s\n", pindex->GetBlockHash().GetHex());
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
{
LOCK(cs_main);
-
CBlock block;
- CBlockIndex* pblockindex = mapBlockIndex[hash];
-
- if(!ReadBlockFromDisk(block, pblockindex))
+ if(!ReadBlockFromDisk(block, pindex))
{
zmqError("Can't read block from disk");
return false;