Skip to content

Commit 19149f5

Browse files
Merge pull request #4632 from Munkybooty/backports-0.19-pr11
Backports 0.19 pr11
2 parents 03abbd3 + 8de8cf3 commit 19149f5

15 files changed

+156
-72
lines changed

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed
4747
OSX_QT_TRANSLATIONS = ar,bg,ca,cs,da,de,es,fa,fi,fr,gd,gl,he,hu,it,ja,ko,lt,lv,pl,pt,ru,sk,sl,sv,uk,zh_CN,zh_TW
4848

4949
DIST_CONTRIB = \
50+
$(top_srcdir)/contrib/debian/copyright \
5051
$(top_srcdir)/contrib/linearize/linearize-data.py \
5152
$(top_srcdir)/contrib/linearize/linearize-hashes.py
52-
5353
DIST_SHARE = \
5454
$(top_srcdir)/share/genbuild.sh \
5555
$(top_srcdir)/share/rpcauth

doc/release-notes-14982.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
New RPCs
2+
--------
3+
4+
- The RPC `getrpcinfo` returns runtime details of the RPC server. At the moment
5+
it returns the active commands and the corresponding execution time.

src/chain.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ const CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const {
5959
return pindex;
6060
}
6161

62-
CBlockIndex* CChain::FindEarliestAtLeast(int64_t nTime) const
62+
CBlockIndex* CChain::FindEarliestAtLeast(int64_t nTime, int height) const
6363
{
64-
std::vector<CBlockIndex*>::const_iterator lower = std::lower_bound(vChain.begin(), vChain.end(), nTime,
65-
[](CBlockIndex* pBlock, const int64_t& time) -> bool { return pBlock->GetBlockTimeMax() < time; });
64+
std::pair<int64_t, int> blockparams = std::make_pair(nTime, height);
65+
std::vector<CBlockIndex*>::const_iterator lower = std::lower_bound(vChain.begin(), vChain.end(), blockparams,
66+
[](CBlockIndex* pBlock, const std::pair<int64_t, int>& blockparams) -> bool { return pBlock->GetBlockTimeMax() < blockparams.first || pBlock->nHeight < blockparams.second; });
6667
return (lower == vChain.end() ? nullptr : *lower);
6768
}
6869

src/chain.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,8 @@ class CChain {
430430
/** Find the last common block between this chain and a block index entry. */
431431
const CBlockIndex *FindFork(const CBlockIndex *pindex) const;
432432

433-
/** Find the earliest block with timestamp equal or greater than the given. */
434-
CBlockIndex* FindEarliestAtLeast(int64_t nTime) const;
433+
/** Find the earliest block with timestamp equal or greater than the given time and height equal or greater than the given height. */
434+
CBlockIndex* FindEarliestAtLeast(int64_t nTime, int height) const;
435435
};
436436

437437
#endif // BITCOIN_CHAIN_H

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ void SetupServerArgs()
702702
gArgs.AddArg("-platform-user=<user>", "Set the username for the \"platform user\", a restricted user intended to be used by Dash Platform, to the specified username.", ArgsManager::ALLOW_ANY, OptionsCategory::MASTERNODE);
703703

704704
gArgs.AddArg("-acceptnonstdtxn", strprintf("Relay and mine \"non-standard\" transactions (%sdefault: %u)", "testnet/regtest only; ", !testnetChainParams->RequireStandard()), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::NODE_RELAY);
705-
gArgs.AddArg("-dustrelayfee=<amt>", strprintf("Fee rate (in %s/kB) used to defined dust, the value of an output such that it will cost more than its value in fees at this fee rate to spend it. (default: %s)", CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE)), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::NODE_RELAY);
705+
gArgs.AddArg("-dustrelayfee=<amt>", strprintf("Fee rate (in %s/kB) used to define dust, the value of an output such that it will cost more than its value in fees at this fee rate to spend it. (default: %s)", CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE)), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::NODE_RELAY);
706706
gArgs.AddArg("-incrementalrelayfee=<amt>", strprintf("Fee rate (in %s/kB) used to define cost of relay, used for mempool limiting and BIP 125 replacement. (default: %s)", CURRENCY_UNIT, FormatMoney(DEFAULT_INCREMENTAL_RELAY_FEE)), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::NODE_RELAY);
707707
gArgs.AddArg("-bytespersigop", strprintf("Equivalent bytes per sigop in transactions for relay and mining (default: %u)", DEFAULT_BYTES_PER_SIGOP), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
708708
gArgs.AddArg("-datacarrier", strprintf("Relay and mine data carrier transactions (default: %u)", DEFAULT_ACCEPT_DATACARRIER), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);

src/interfaces/chain.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,30 +89,16 @@ class LockImpl : public Chain::Lock, public UniqueLock<CCriticalSection>
8989
CBlockIndex* block = ::ChainActive()[height];
9090
return block && ((block->nStatus & BLOCK_HAVE_DATA) != 0) && block->nTx > 0;
9191
}
92-
Optional<int> findFirstBlockWithTime(int64_t time, uint256* hash) override
92+
Optional<int> findFirstBlockWithTimeAndHeight(int64_t time, int height, uint256* hash) override
9393
{
9494
LockAnnotation lock(::cs_main);
95-
CBlockIndex* block = ::ChainActive().FindEarliestAtLeast(time);
95+
CBlockIndex* block = ::ChainActive().FindEarliestAtLeast(time, height);
9696
if (block) {
9797
if (hash) *hash = block->GetBlockHash();
9898
return block->nHeight;
9999
}
100100
return nullopt;
101101
}
102-
Optional<int> findFirstBlockWithTimeAndHeight(int64_t time, int height) override
103-
{
104-
// TODO: Could update CChain::FindEarliestAtLeast() to take a height
105-
// parameter and use it with std::lower_bound() to make this
106-
// implementation more efficient and allow combining
107-
// findFirstBlockWithTime and findFirstBlockWithTimeAndHeight into one
108-
// method.
109-
for (CBlockIndex* block = ::ChainActive()[height]; block; block = ::ChainActive().Next(block)) {
110-
if (block->GetBlockTime() >= time) {
111-
return block->nHeight;
112-
}
113-
}
114-
return nullopt;
115-
}
116102
Optional<int> findPruned(int start_height, Optional<int> stop_height) override
117103
{
118104
LockAnnotation lock(::cs_main);

src/interfaces/chain.h

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,12 @@ class Chain
9999
//! pruned), and contains transactions.
100100
virtual bool haveBlockOnDisk(int height) = 0;
101101

102-
//! Return height of the first block in the chain with timestamp equal
103-
//! or greater than the given time, or nullopt if there is no block with
104-
//! a high enough timestamp. Also return the block hash as an optional
105-
//! output parameter (to avoid the cost of a second lookup in case this
106-
//! information is needed.)
107-
virtual Optional<int> findFirstBlockWithTime(int64_t time, uint256* hash) = 0;
108-
109102
//! Return height of the first block in the chain with timestamp equal
110103
//! or greater than the given time and height equal or greater than the
111-
//! given height, or nullopt if there is no such block.
112-
//!
113-
//! Calling this with height 0 is equivalent to calling
114-
//! findFirstBlockWithTime, but less efficient because it requires a
115-
//! linear instead of a binary search.
116-
virtual Optional<int> findFirstBlockWithTimeAndHeight(int64_t time, int height) = 0;
104+
//! given height, or nullopt if there is no block with a high enough
105+
//! timestamp and height. Also return the block hash as an optional output parameter
106+
//! (to avoid the cost of a second lookup in case this information is needed.)
107+
virtual Optional<int> findFirstBlockWithTimeAndHeight(int64_t time, int height, uint256* hash) = 0;
117108

118109
//! Return height of last block in the specified range which is pruned, or
119110
//! nullopt if no block in the range is pruned. Range is inclusive.

src/rpc/blockchain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ static UniValue pruneblockchain(const JSONRPCRequest& request)
12061206
// too low to be a block time (corresponds to timestamp from Sep 2001).
12071207
if (heightParam > 1000000000) {
12081208
// Add a 2 hour buffer to include blocks which might have had old timestamps
1209-
CBlockIndex* pindex = ::ChainActive().FindEarliestAtLeast(heightParam - TIMESTAMP_WINDOW);
1209+
CBlockIndex* pindex = ::ChainActive().FindEarliestAtLeast(heightParam - TIMESTAMP_WINDOW, 0);
12101210
if (!pindex) {
12111211
throw JSONRPCError(RPC_INVALID_PARAMETER, "Could not find block with at least the specified timestamp.");
12121212
}

src/rpc/rawtransaction.cpp

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -532,33 +532,44 @@ static UniValue decoderawtransaction(const JSONRPCRequest& request)
532532
return result;
533533
}
534534

535+
static std::string GetAllOutputTypes()
536+
{
537+
std::string ret;
538+
for (int i = TX_NONSTANDARD; i <= TX_NULL_DATA; ++i) {
539+
if (i != TX_NONSTANDARD) ret += ", ";
540+
ret += GetTxnOutputType(static_cast<txnouttype>(i));
541+
}
542+
return ret;
543+
}
544+
535545
static UniValue decodescript(const JSONRPCRequest& request)
536546
{
537-
if (request.fHelp || request.params.size() != 1)
538-
throw std::runtime_error(
539-
RPCHelpMan{"decodescript",
547+
const RPCHelpMan help{"decodescript",
540548
"\nDecode a hex-encoded script.\n",
541549
{
542550
{"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "the hex-encoded script"},
543551
},
544552
RPCResult{
545553
"{\n"
546-
" \"asm\":\"asm\", (string) Script public key\n"
547-
" \"hex\":\"hex\", (string) hex-encoded public key\n"
548-
" \"type\":\"type\", (string) The output type\n"
549-
" \"reqSigs\": n, (numeric) The required signatures\n"
550-
" \"addresses\": [ (json array of string)\n"
551-
" \"address\" (string) dash address\n"
554+
" \"asm\":\"asm\", (string) Script public key\n"
555+
" \"type\":\"type\", (string) The output type (e.g. "+GetAllOutputTypes()+")\n"
556+
" \"reqSigs\": n, (numeric) The required signatures\n"
557+
" \"addresses\": [ (json array of string)\n"
558+
" \"address\" (string) dash address\n"
552559
" ,...\n"
553560
" ],\n"
554-
" \"p2sh\",\"address\" (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH).\n"
561+
" \"p2sh\":\"str\" (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH).\n"
555562
"}\n"
556563
},
557564
RPCExamples{
558565
HelpExampleCli("decodescript", "\"hexstring\"")
559566
+ HelpExampleRpc("decodescript", "\"hexstring\"")
560567
},
561-
}.ToString());
568+
};
569+
570+
if (request.fHelp || !help.IsValidNumArgs(request.params.size())) {
571+
throw std::runtime_error(help.ToString());
572+
}
562573

563574
RPCTypeCheck(request.params, {UniValue::VSTR});
564575

@@ -570,7 +581,7 @@ static UniValue decodescript(const JSONRPCRequest& request)
570581
} else {
571582
// Empty scripts are valid
572583
}
573-
ScriptPubKeyToUniv(script, r, false);
584+
ScriptPubKeyToUniv(script, r, /* fIncludeHex */ false);
574585

575586
UniValue type;
576587

src/rpc/server.cpp

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,35 @@ static bool ExecuteCommand(const CRPCCommand& command, const JSONRPCRequest& req
3535
// Any commands submitted by this user will have their commands filtered based on the mapPlatformRestrictions
3636
static const std::string defaultPlatformUser = "platform-user";
3737

38+
struct RPCCommandExecutionInfo
39+
{
40+
std::string method;
41+
int64_t start;
42+
};
43+
44+
struct RPCServerInfo
45+
{
46+
Mutex mutex;
47+
std::list<RPCCommandExecutionInfo> active_commands GUARDED_BY(mutex);
48+
};
49+
50+
static RPCServerInfo g_rpc_server_info;
51+
52+
struct RPCCommandExecution
53+
{
54+
std::list<RPCCommandExecutionInfo>::iterator it;
55+
explicit RPCCommandExecution(const std::string& method)
56+
{
57+
LOCK(g_rpc_server_info.mutex);
58+
it = g_rpc_server_info.active_commands.insert(g_rpc_server_info.active_commands.cend(), {method, GetTimeMicros()});
59+
}
60+
~RPCCommandExecution()
61+
{
62+
LOCK(g_rpc_server_info.mutex);
63+
g_rpc_server_info.active_commands.erase(it);
64+
}
65+
};
66+
3867
static struct CRPCSignals
3968
{
4069
boost::signals2::signal<void ()> Started;
@@ -191,11 +220,40 @@ static UniValue uptime(const JSONRPCRequest& jsonRequest)
191220
return GetTime() - GetStartupTime();
192221
}
193222

223+
static UniValue getrpcinfo(const JSONRPCRequest& request)
224+
{
225+
if (request.fHelp || request.params.size() > 0) {
226+
throw std::runtime_error(
227+
RPCHelpMan{"getrpcinfo",
228+
"\nReturns details of the RPC server.\n",
229+
{},
230+
RPCResults{},
231+
RPCExamples{""},
232+
}.ToString()
233+
);
234+
}
235+
236+
LOCK(g_rpc_server_info.mutex);
237+
UniValue active_commands(UniValue::VARR);
238+
for (const RPCCommandExecutionInfo& info : g_rpc_server_info.active_commands) {
239+
UniValue entry(UniValue::VOBJ);
240+
entry.pushKV("method", info.method);
241+
entry.pushKV("duration", GetTimeMicros() - info.start);
242+
active_commands.push_back(entry);
243+
}
244+
245+
UniValue result(UniValue::VOBJ);
246+
result.pushKV("active_commands", active_commands);
247+
248+
return result;
249+
}
250+
194251
// clang-format off
195252
static const CRPCCommand vRPCCommands[] =
196253
{ // category name actor (function) argNames
197254
// --------------------- ------------------------ ----------------------- ----------
198255
/* Overall control/query calls */
256+
{ "control", "getrpcinfo", &getrpcinfo, {} },
199257
{ "control", "help", &help, {"command","subcommand"} },
200258
{ "control", "stop", &stop, {"wait"} },
201259
{ "control", "uptime", &uptime, {} },
@@ -495,6 +553,7 @@ static bool ExecuteCommand(const CRPCCommand& command, const JSONRPCRequest& req
495553

496554
try
497555
{
556+
RPCCommandExecution execution(request.strMethod);
498557
// Execute, convert arguments to array if necessary
499558
if (request.params.isObject()) {
500559
return command.actor(transformNamedArguments(request, command.argNames), result, last_handler);

src/test/skiplist_tests.cpp

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ BOOST_AUTO_TEST_CASE(findearliestatleast_test)
135135
// Pick a random element in vBlocksMain.
136136
int r = InsecureRandRange(vBlocksMain.size());
137137
int64_t test_time = vBlocksMain[r].nTime;
138-
CBlockIndex *ret = chain.FindEarliestAtLeast(test_time);
138+
CBlockIndex* ret = chain.FindEarliestAtLeast(test_time, 0);
139139
BOOST_CHECK(ret->nTimeMax >= test_time);
140140
BOOST_CHECK((ret->pprev==nullptr) || ret->pprev->nTimeMax < test_time);
141141
BOOST_CHECK(vBlocksMain[r].GetAncestor(ret->nHeight) == ret);
@@ -157,22 +157,34 @@ BOOST_AUTO_TEST_CASE(findearliestatleast_edge_test)
157157
CChain chain;
158158
chain.SetTip(&blocks.back());
159159

160-
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(50)->nHeight, 0);
161-
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(100)->nHeight, 0);
162-
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(150)->nHeight, 3);
163-
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(200)->nHeight, 3);
164-
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(250)->nHeight, 6);
165-
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(300)->nHeight, 6);
166-
BOOST_CHECK(!chain.FindEarliestAtLeast(350));
167-
168-
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(0)->nHeight, 0);
169-
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(-1)->nHeight, 0);
170-
171-
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(std::numeric_limits<int64_t>::min())->nHeight, 0);
172-
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(-int64_t(std::numeric_limits<unsigned int>::max()) - 1)->nHeight, 0);
173-
BOOST_CHECK(!chain.FindEarliestAtLeast(std::numeric_limits<int64_t>::max()));
174-
BOOST_CHECK(!chain.FindEarliestAtLeast(std::numeric_limits<unsigned int>::max()));
175-
BOOST_CHECK(!chain.FindEarliestAtLeast(int64_t(std::numeric_limits<unsigned int>::max()) + 1));
160+
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(50, 0)->nHeight, 0);
161+
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(100, 0)->nHeight, 0);
162+
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(150, 0)->nHeight, 3);
163+
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(200, 0)->nHeight, 3);
164+
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(250, 0)->nHeight, 6);
165+
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(300, 0)->nHeight, 6);
166+
BOOST_CHECK(!chain.FindEarliestAtLeast(350, 0));
167+
168+
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(0, 0)->nHeight, 0);
169+
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(-1, 0)->nHeight, 0);
170+
171+
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(std::numeric_limits<int64_t>::min(), 0)->nHeight, 0);
172+
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(-int64_t(std::numeric_limits<unsigned int>::max()) - 1, 0)->nHeight, 0);
173+
BOOST_CHECK(!chain.FindEarliestAtLeast(std::numeric_limits<int64_t>::max(), 0));
174+
BOOST_CHECK(!chain.FindEarliestAtLeast(std::numeric_limits<unsigned int>::max(), 0));
175+
BOOST_CHECK(!chain.FindEarliestAtLeast(int64_t(std::numeric_limits<unsigned int>::max()) + 1, 0));
176+
177+
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(0, -1)->nHeight, 0);
178+
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(0, 0)->nHeight, 0);
179+
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(0, 3)->nHeight, 3);
180+
BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(0, 8)->nHeight, 8);
181+
BOOST_CHECK(!chain.FindEarliestAtLeast(0, 9));
182+
183+
CBlockIndex* ret1 = chain.FindEarliestAtLeast(100, 2);
184+
BOOST_CHECK(ret1->nTimeMax >= 100 && ret1->nHeight == 2);
185+
BOOST_CHECK(!chain.FindEarliestAtLeast(300, 9));
186+
CBlockIndex* ret2 = chain.FindEarliestAtLeast(200, 4);
187+
BOOST_CHECK(ret2->nTimeMax >= 200 && ret2->nHeight == 4);
176188
}
177189

178190
BOOST_AUTO_TEST_SUITE_END()

src/wallet/coincontrol.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ class CCoinControl
4949
bool m_avoid_partial_spends;
5050
//! Fee estimation mode to control arguments to estimateSmartFee
5151
FeeEstimateMode m_fee_mode;
52+
//! Minimum chain depth value for coin availability
53+
int m_min_depth{0};
5254
//! Controls which types of coins are allowed to be used (default: ALL_COINS)
5355
CoinType nCoinType;
5456

src/wallet/wallet.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2205,7 +2205,7 @@ int64_t CWallet::RescanFromTime(int64_t startTime, const WalletRescanReserver& r
22052205
uint256 start_block;
22062206
{
22072207
auto locked_chain = chain().lock();
2208-
const Optional<int> start_height = locked_chain->findFirstBlockWithTime(startTime - TIMESTAMP_WINDOW, &start_block);
2208+
const Optional<int> start_height = locked_chain->findFirstBlockWithTimeAndHeight(startTime - TIMESTAMP_WINDOW, 0, &start_block);
22092209
const Optional<int> tip_height = locked_chain->getHeight();
22102210
WalletLogPrintf("%s: Rescanning last %i blocks\n", __func__, tip_height && start_height ? *tip_height - *start_height + 1 : 0);
22112211
}
@@ -3579,7 +3579,7 @@ bool CWallet::CreateTransaction(interfaces::Chain::Lock& locked_chain, const std
35793579
{
35803580
CAmount nAmountAvailable{0};
35813581
std::vector<COutput> vAvailableCoins;
3582-
AvailableCoins(*locked_chain, vAvailableCoins, true, &coin_control);
3582+
AvailableCoins(*locked_chain, vAvailableCoins, true, &coin_control, 1, MAX_MONEY, MAX_MONEY, 0, coin_control.m_min_depth);
35833583
CoinSelectionParams coin_selection_params; // Parameters for coin selection, init with dummy
35843584
coin_selection_params.use_bnb = false; // never use BnB
35853585

@@ -5223,7 +5223,7 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
52235223
// unless a full rescan was requested
52245224
if (gArgs.GetArg("-rescan", 0) != 2) {
52255225
if (walletInstance->nTimeFirstKey) {
5226-
if (Optional<int> first_block = locked_chain->findFirstBlockWithTimeAndHeight(walletInstance->nTimeFirstKey - TIMESTAMP_WINDOW, rescan_height)) {
5226+
if (Optional<int> first_block = locked_chain->findFirstBlockWithTimeAndHeight(walletInstance->nTimeFirstKey - TIMESTAMP_WINDOW, rescan_height, nullptr)) {
52275227
rescan_height = *first_block;
52285228
}
52295229
}

0 commit comments

Comments
 (0)