From d5046e72f4180b7932368919ae08da24be8e9583 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Mon, 20 Mar 2017 12:27:07 -0400 Subject: [PATCH] Avoid scoped_connection compile error with boost 1.55.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Construct scoped_connection directly instead of relying on copy initialization and move constructor. Avoids the following compile error in debian jessie: ``` In file included from /usr/include/boost/signals2/signal.hpp:21:0, from ./util.h:29, from ./dbwrapper.h:11, from ./txdb.h:10, from ./test/test_bitcoin.h:11, from qt/test/wallettests.cpp:11: /usr/include/boost/signals2/connection.hpp: In function ‘uint256 {anonymous}::SendCoins(CWallet&, SendCoinsDialog&, const CBitcoinAddress&, CAmount)’: /usr/include/boost/signals2/connection.hpp:234:7: error: ‘boost::signals2::scoped_connection::scoped_connection(const boost::signals2::scoped_connection&)’ is private scoped_connection(const scoped_connection &other); ^ qt/test/wallettests.cpp:47:6: error: within this context }); ^ ``` Error reported by Pavel Janík in https://github.com/bitcoin/bitcoin/pull/9974#issuecomment-287550034 --- src/qt/test/wallettests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp index 2bb7f01fdd4..118b54e8de2 100644 --- a/src/qt/test/wallettests.cpp +++ b/src/qt/test/wallettests.cpp @@ -42,9 +42,9 @@ uint256 SendCoins(CWallet& wallet, SendCoinsDialog& sendCoinsDialog, const CBitc entry->findChild("payTo")->setText(QString::fromStdString(address.ToString())); entry->findChild("payAmount")->setValue(amount); uint256 txid; - boost::signals2::scoped_connection c = wallet.NotifyTransactionChanged.connect([&txid](CWallet*, const uint256& hash, ChangeType status) { + boost::signals2::scoped_connection c(wallet.NotifyTransactionChanged.connect([&txid](CWallet*, const uint256& hash, ChangeType status) { if (status == CT_NEW) txid = hash; - }); + })); ConfirmSend(); QMetaObject::invokeMethod(&sendCoinsDialog, "on_sendButton_clicked"); return txid;