rpcwallet: Replace boost::optional<T>::emplace with simple assignment of T{}

Optional::emplace() was only added in boost 1.56, see
2e583aaf30

To simply work around https://github.com/bitcoin/bitcoin/issues/18943,
replace it with assignment of T{}
This commit is contained in:
MarcoFalke 2020-05-11 09:59:32 -04:00
parent 88d8b4e182
commit fa182a8794
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

View File

@ -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");
}