aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2017-08-09 16:14:37 +0200
committerpracticalswift <practicalswift@users.noreply.github.com>2017-11-09 16:53:34 +0100
commitf72cbf9ba970e997be84fb7b20795c6b9c62fb42 (patch)
tree383f6395e4b38df1b8acb6c97b16b9a90c6be3a6 /src/net_processing.cpp
parent8ccf1bb0c31108762e47f28d9d592e8d4c788564 (diff)
Use unique_ptr for pfilter (CBloomFilter)
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 6866cd3409..3b26a98f45 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -2755,8 +2755,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
else
{
LOCK(pfrom->cs_filter);
- delete pfrom->pfilter;
- pfrom->pfilter = new CBloomFilter(filter);
+ pfrom->pfilter.reset(new CBloomFilter(filter));
pfrom->pfilter->UpdateEmptyFull();
pfrom->fRelayTxes = true;
}
@@ -2792,8 +2791,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
{
LOCK(pfrom->cs_filter);
if (pfrom->GetLocalServices() & NODE_BLOOM) {
- delete pfrom->pfilter;
- pfrom->pfilter = new CBloomFilter();
+ pfrom->pfilter.reset(new CBloomFilter());
}
pfrom->fRelayTxes = true;
}