Avoid scoped_connection compile error with boost 1.55.0

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 <Pavel@Janik.cz> in
https://github.com/bitcoin/bitcoin/pull/9974#issuecomment-287550034
pull/10039/head
Russell Yanofsky 8 years ago
parent d34995a7ba
commit d5046e72f4

@ -42,9 +42,9 @@ uint256 SendCoins(CWallet& wallet, SendCoinsDialog& sendCoinsDialog, const CBitc
entry->findChild<QValidatedLineEdit*>("payTo")->setText(QString::fromStdString(address.ToString()));
entry->findChild<BitcoinAmountField*>("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;

Loading…
Cancel
Save