diff options
| author | Jonas Schnelli <[email protected]> | 2015-09-16 16:42:23 +0200 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2015-09-16 16:51:21 +0200 |
| commit | d76a8acb9b7bcabf43e3e05168a36911f187818d (patch) | |
| tree | 2322acc9cd1448c524e7507a517deca6da7cf43c /src/zmq/zmqpublishnotifier.cpp | |
| parent | configure.ac: Revert autotools-auto-updated 2.69 autoconf requirement (diff) | |
| download | discoin-d76a8acb9b7bcabf43e3e05168a36911f187818d.tar.xz discoin-d76a8acb9b7bcabf43e3e05168a36911f187818d.zip | |
use CBlockIndex* insted of uint256 for UpdatedBlockTip signal
- removes mapBlockIndex find operation
- theoretically allows removing the cs_main lock during zqm notification while introducing a new file position lock
Diffstat (limited to 'src/zmq/zmqpublishnotifier.cpp')
| -rw-r--r-- | src/zmq/zmqpublishnotifier.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/zmq/zmqpublishnotifier.cpp b/src/zmq/zmqpublishnotifier.cpp index 0a6d7d0db..4c3eb8f2d 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; |