Skip to content

Commit fa182a8

Browse files
author
MarcoFalke
committed
rpcwallet: Replace boost::optional<T>::emplace with simple assignment of T{}
Optional::emplace() was only added in boost 1.56, see boostorg/optional@2e583aa To simply work around bitcoin/bitcoin#18943, replace it with assignment of T{}
1 parent 88d8b4e commit fa182a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,8 +1557,8 @@ static UniValue listsinceblock(const JSONRPCRequest& request)
15571557
uint256 blockId;
15581558
if (!request.params[0].isNull() && !request.params[0].get_str().empty()) {
15591559
blockId = ParseHashV(request.params[0], "blockhash");
1560-
height.emplace();
1561-
altheight.emplace();
1560+
height = int{};
1561+
altheight = int{};
15621562
if (!pwallet->chain().findCommonAncestor(blockId, pwallet->GetLastBlockHash(), /* ancestor out */ FoundBlock().height(*height), /* blockId out */ FoundBlock().height(*altheight))) {
15631563
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
15641564
}

0 commit comments

Comments
 (0)