Skip to content

Commit

Permalink
First attempt to make it compile
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed Nov 18, 2024
1 parent b9b4300 commit cad4dc6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/interfaces/chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,9 @@ class Chain

//! Get stake weight.
virtual uint64_t getStakeWeight(const wallet::CWallet& wallet) = 0;

//! Get staking RPC commands.
virtual Span<const CRPCCommand> getStakingRPCCommands() = 0;
#endif
};

Expand Down
4 changes: 4 additions & 0 deletions src/node/interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,10 @@ class ChainImpl : public Chain
{
return GetStakeWeight(wallet);
}
Span<const CRPCCommand> getStakingRPCCommands() override
{
return wallet::GetStakingRPCCommands();
}
#endif

bool hasAssumedValidChain() override
Expand Down
7 changes: 7 additions & 0 deletions src/primitives/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ Txid CMutableTransaction::GetHash() const
return Txid::FromUint256((HashWriter{} << TX_NO_WITNESS(*this)).GetHash());
}

bool CTransaction::ComputeHasWitness() const
{
return std::any_of(vin.begin(), vin.end(), [](const auto& input) {
return !input.scriptWitness.IsNull();
});
}

Txid CTransaction::ComputeHash() const
{
return Txid::FromUint256((HashWriter{} << TX_NO_WITNESS(*this)).GetHash());
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ class WalletLoaderImpl : public WalletLoader
{
std::vector<Span<const CRPCCommand>> commands;
commands.push_back(GetWalletRPCCommands());
commands.push_back(GetStakingRPCCommands());
commands.push_back(m_context.chain->getStakingRPCCommands());
for(size_t i = 0; i < commands.size(); i++) {
for (const CRPCCommand& command : commands[i]) {
m_rpc_commands.emplace_back(command.category, command.name, [this, &command](const JSONRPCRequest& request, UniValue& result, bool last_handler) {
Expand Down

0 comments on commit cad4dc6

Please sign in to comment.