Skip to content

Commit

Permalink
Re-enable ENABLE_WALLET checks in code.
Browse files Browse the repository at this point in the history
The proper fix for those, broken in the last upstream merge, is
adding an include of <config/bitcoin-config.h>, which re-enables
the define to show up properly.
  • Loading branch information
domob1812 committed Mar 7, 2024
1 parent 6ba388e commit 5423c49
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/rpc/names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <config/bitcoin-config.h>

#include <base58.h>
#include <chainparams.h>
#include <common/args.h>
Expand All @@ -26,8 +28,10 @@
#include <util/any.h>
#include <util/strencodings.h>
#include <validation.h>
#include <wallet/rpc/util.h>
#include <wallet/wallet.h>
#ifdef ENABLE_WALLET
# include <wallet/rpc/util.h>
# include <wallet/wallet.h>
#endif

#include <univalue.h>

Expand Down Expand Up @@ -133,6 +137,7 @@ addExpirationInfo (const ChainstateManager& chainman,
data.pushKV ("expired", expired);
}

#ifdef ENABLE_WALLET
/**
* Adds the "ismine" field giving ownership info to the JSON object.
*/
Expand All @@ -148,6 +153,7 @@ addOwnershipInfo (const CScript& addr, const wallet::CWallet* pwallet,
const bool isMine = (mine & wallet::ISMINE_SPENDABLE);
data.pushKV ("ismine", isMine);
}
#endif // ENABLE_WALLET

namespace
{
Expand Down
7 changes: 5 additions & 2 deletions src/rpc/names.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// Copyright (c) 2014-2021 Daniel Kraft
// Copyright (c) 2014-2024 Daniel Kraft
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_RPC_NAMES_H
#define BITCOIN_RPC_NAMES_H

#include <script/script.h>
#include <config/bitcoin-config.h>

#include <names/encoding.h>
#include <rpc/util.h>
#include <script/script.h>
#include <span.h>

#include <string>
Expand All @@ -35,12 +36,14 @@ void addExpirationInfo (const ChainstateManager& chainman,

Span<const CRPCCommand> GetNameRPCCommands ();

#ifdef ENABLE_WALLET
namespace wallet {
class CWallet;
} // namespace wallet
void addOwnershipInfo (const CScript& addr,
const wallet::CWallet* pwallet,
UniValue& data);
#endif // ENABLE_WALLET

/**
* Decodes a name given through the RPC interface and throws a
Expand Down

0 comments on commit 5423c49

Please sign in to comment.