Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ after_success:
FILE_ENV="./ci/test/00_setup_env_amd64_qt5.sh"

- stage: test
name: 'x86_64 Linux [GOAL: install] [trusty] [depends for now]'
name: 'x86_64 Linux [GOAL: install] [trusty] [no functional tests, no depends, only system libs]'
env: >-
FILE_ENV="./ci/test/00_setup_env_amd64_trusty.sh"

Expand All @@ -269,6 +269,6 @@ after_success:
FILE_ENV="./ci/test/00_setup_env_amd64_nowallet.sh"

- stage: test
name: 'macOS 10.12 [GOAL: deploy]'
name: 'macOS 10.12 [GOAL: deploy] [no functional tests]'
env: >-
FILE_ENV="./ci/test/00_setup_env_mac.sh"
4 changes: 2 additions & 2 deletions src/interfaces/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ class WalletImpl : public Wallet
LOCK(m_wallet->cs_wallet);
auto mi = m_wallet->mapWallet.find(txid);
if (mi != m_wallet->mapWallet.end()) {
num_blocks = locked_chain->getHeight().value_or(-1);
num_blocks = locked_chain->getHeight().get_value_or(-1);
in_mempool = mi->second.InMempool();
order_form = mi->second.vOrderForm;
tx_status = MakeWalletTxStatus(*locked_chain, mi->second);
Expand Down Expand Up @@ -411,7 +411,7 @@ class WalletImpl : public Wallet
return false;
}
balances = getBalances();
num_blocks = locked_chain->getHeight().value_or(-1);
num_blocks = locked_chain->getHeight().get_value_or(-1);
return true;
}
CAmount getBalance() override
Expand Down
21 changes: 19 additions & 2 deletions src/rpc/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,21 @@ static UniValue getrpcinfo(const JSONRPCRequest& request)
RPCHelpMan{"getrpcinfo",
"\nReturns details of the RPC server.\n",
{},
RPCResults{},
RPCExamples{""},
RPCResult{
"{\n"
" \"active_commands\" (array) All active commands\n"
" [\n"
" { (object) Information about an active command\n"
" \"method\" (string) The name of the RPC command \n"
" \"duration\" (numeric) The running time in microseconds\n"
" },...\n"
" ],\n"
" \"logpath\": \"xxx\" (string) The complete file path to the debug log\n"
Comment thread
UdjinM6 marked this conversation as resolved.
Outdated
"}\n"
},
RPCExamples{
HelpExampleCli("getrpcinfo", "")
+ HelpExampleRpc("getrpcinfo", "")},
}.ToString()
);
}
Expand All @@ -244,6 +257,10 @@ static UniValue getrpcinfo(const JSONRPCRequest& request)
UniValue result(UniValue::VOBJ);
result.pushKV("active_commands", active_commands);

const std::string path = LogInstance().m_file_path.string();
UniValue log_path(UniValue::VSTR, path);
result.pushKV("logpath", log_path);

return result;
}

Expand Down
6 changes: 5 additions & 1 deletion src/validationinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <txmempool.h>

#include <future>
#include <utility>

#include <boost/signals2/signal.hpp>

Expand Down Expand Up @@ -91,7 +92,10 @@ size_t CMainSignals::CallbacksPending() {
}

void CMainSignals::RegisterWithMempoolSignals(CTxMemPool& pool) {
g_connNotifyEntryRemoved.emplace(&pool, pool.NotifyEntryRemoved.connect(std::bind(&CMainSignals::MempoolEntryRemoved, this, std::placeholders::_1, std::placeholders::_2)));
g_connNotifyEntryRemoved.emplace(std::piecewise_construct,
std::forward_as_tuple(&pool),
std::forward_as_tuple(pool.NotifyEntryRemoved.connect(std::bind(&CMainSignals::MempoolEntryRemoved, this, std::placeholders::_1, std::placeholders::_2)))
);
}

void CMainSignals::UnregisterWithMempoolSignals(CTxMemPool& pool) {
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/rpcdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ UniValue dumpwallet(const JSONRPCRequest& request)
file << strprintf("# Wallet dump created by Dash Core %s\n", CLIENT_BUILD);
file << strprintf("# * Created on %s\n", FormatISO8601DateTime(GetTime()));
const Optional<int> tip_height = locked_chain->getHeight();
file << strprintf("# * Best block at time of backup was %i (%s),\n", tip_height.value_or(-1), tip_height ? locked_chain->getBlockHash(*tip_height).ToString() : "(missing block hash)");
file << strprintf("# * Best block at time of backup was %i (%s),\n", tip_height.get_value_or(-1), tip_height ? locked_chain->getBlockHash(*tip_height).ToString() : "(missing block hash)");
file << strprintf("# mined on %s\n", tip_height ? FormatISO8601DateTime(locked_chain->getBlockTime(*tip_height)) : "(missing block time)");
file << "\n";

Expand Down
2 changes: 1 addition & 1 deletion src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3402,7 +3402,7 @@ static uint32_t GetLocktimeForNewTransaction(interfaces::Chain& chain, interface
// now we ensure code won't be written that makes assumptions about
// nLockTime that preclude a fix later.
if (IsCurrentForAntiFeeSniping(chain, locked_chain)) {
locktime = locked_chain.getHeight().value_or(-1);
locktime = locked_chain.getHeight().get_value_or(-1);

// Secondly occasionally randomly pick a nLockTime even further back, so
// that transactions that are delayed after signing for whatever reason,
Expand Down
2 changes: 2 additions & 0 deletions test/functional/interface_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests some generic aspects of the RPC interface."""

import os
from test_framework.authproxy import JSONRPCException
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_greater_than_or_equal
Expand Down Expand Up @@ -31,6 +32,7 @@ def test_getrpcinfo(self):
command = info['active_commands'][0]
assert_equal(command['method'], 'getrpcinfo')
assert_greater_than_or_equal(command['duration'], 0)
assert_equal(info['logpath'], os.path.join(self.nodes[0].datadir, 'regtest', 'debug.log'))

def test_batch_request(self):
self.log.info("Testing basic JSON-RPC batch request...")
Expand Down