aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <[email protected]>2020-05-11 09:59:32 -0400
committerMarcoFalke <[email protected]>2020-05-11 09:53:49 -0400
commitfa182a8794cbf9be1aa91d1d75e65bc7800156bc (patch)
tree8515a7e25084c508d014397baa62413dd582db79
parentMerge #18901: fuzz: use std::optional for sep_pos_opt variable (diff)
downloaddiscoin-fa182a8794cbf9be1aa91d1d75e65bc7800156bc.tar.xz
discoin-fa182a8794cbf9be1aa91d1d75e65bc7800156bc.zip
rpcwallet: Replace boost::optional<T>::emplace with simple assignment of T{}
Optional::emplace() was only added in boost 1.56, see https://github.com/boostorg/optional/commit/2e583aaf30964afd66c1284aa71d0d8b42fa440d To simply work around https://github.com/bitcoin/bitcoin/issues/18943, replace it with assignment of T{}
-rw-r--r--src/wallet/rpcwallet.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index dda00f1fe..fcf78bd4b 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -1557,8 +1557,8 @@ static UniValue listsinceblock(const JSONRPCRequest& request)
uint256 blockId;
if (!request.params[0].isNull() && !request.params[0].get_str().empty()) {
blockId = ParseHashV(request.params[0], "blockhash");
- height.emplace();
- altheight.emplace();
+ height = int{};
+ altheight = int{};
if (!pwallet->chain().findCommonAncestor(blockId, pwallet->GetLastBlockHash(), /* ancestor out */ FoundBlock().height(*height), /* blockId out */ FoundBlock().height(*altheight))) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
}