Skip to content

Commit e982db2

Browse files
Merge dashpay#5897: backport: trivial 2024 02 22
098748a Merge bitcoin#25589: test: speedup wallet_coinbase_category.py (MacroFake) 8cc7f38 Merge bitcoin#25568: Remove my key from trusted-keys (MacroFake) d1018ff Merge bitcoin#25506: Rephrase error message for invalid value of `-peertimeout` (MacroFake) 64a6f74 Merge bitcoin#25457: Use more specific path when including `memenv.h` header (laanwj) 581dba9 Merge bitcoin#25451: test: `-whitebind` and `-bind` with `-listen=0` should throw an error (MacroFake) 6a8b3f2 Merge bitcoin#25440: log: Use consistent wording in random.cpp log (MacroFake) 6af409d Merge bitcoin#25425: build: Fix `::_wsystem` check (laanwj) fa14df6 Merge bitcoin#25370: test: check for `getblocktxn` request with out-of-bounds tx index (MacroFake) da4fd2e Merge bitcoin#25367: [contrib] message-capture-parser: fix out of bounds error for empty vectors (MacroFake) Pull request description: ## Issue being fixed or feature implemented batch of trivial backports; small batch as a lot of them ended up causing test failures ## What was done? ## How Has This Been Tested? Building locally; tests not ran ## Breaking Changes Didn't see any yet; didn't review much yet ## Checklist: _Go over all the following points, and put an `x` in all the boxes that apply._ - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ Top commit has no ACKs. Tree-SHA512: e35c74c3f93556e42803da659ded780a8c2ba60a7ae322b8e15590189ddcef47dbccbd42b195c4a09a3ba149dc53c129e0c761cd299d66a8e40b7b4bc5fd4e87
2 parents 533d8e2 + 098748a commit e982db2

File tree

10 files changed

+18
-8
lines changed

10 files changed

+18
-8
lines changed

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,8 +1288,8 @@ AC_LINK_IFELSE(
12881288
AC_MSG_CHECKING([for ::_wsystem])
12891289
AC_LINK_IFELSE(
12901290
[ AC_LANG_PROGRAM(
1291-
[[ ]],
1292-
[[ int nErr = ::_wsystem(""); ]]
1291+
[[ #include <stdlib.h> ]],
1292+
[[ int nErr = ::_wsystem(NULL); ]]
12931293
)],
12941294
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_WSYSTEM, 1, Define to 1 if you have the `::wsystem' function.)],
12951295
[ AC_MSG_RESULT(no) ]

contrib/message-capture/message-capture-parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ def to_jsonable(obj: Any) -> Any:
7979
val = getattr(obj, slot, None)
8080
if slot in HASH_INTS and isinstance(val, int):
8181
ret[slot] = ser_uint256(val).hex()
82-
elif slot in HASH_INT_VECTORS and isinstance(val[0], int):
82+
elif slot in HASH_INT_VECTORS:
83+
assert all(isinstance(a, int) for a in val)
8384
ret[slot] = [ser_uint256(a).hex() for a in val]
8485
else:
8586
ret[slot] = to_jsonable(val)
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
71A3B16735405025D447E8F274810B012346C9A6
2-
133EAC179436F14A5CF1B794860FEB804E669320
32
B8B3F1C0E58C15DB6A81D30C3648A882F4316B9B
43
E777299FC265DD04793070EB944D35F9AC3DB76A
54
D1DBF2C4B96F2DEBF4C16654410108112E7EA81F

src/Makefile.leveldb.include

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ LIBMEMENV = $(LIBMEMENV_INT)
1313

1414
LEVELDB_CPPFLAGS =
1515
LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include
16-
LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv
1716

1817
LEVELDB_CPPFLAGS_INT =
1918
LEVELDB_CPPFLAGS_INT += -I$(srcdir)/leveldb

src/dbwrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <leveldb/cache.h>
1111
#include <leveldb/env.h>
1212
#include <leveldb/filter_policy.h>
13-
#include <memenv.h>
13+
#include <leveldb/helpers/memenv/memenv.h>
1414
#include <stdint.h>
1515
#include <algorithm>
1616
#include <optional>

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
13771377

13781378
peer_connect_timeout = args.GetArg("-peertimeout", DEFAULT_PEER_CONNECT_TIMEOUT);
13791379
if (peer_connect_timeout <= 0) {
1380-
return InitError(Untranslated("peertimeout cannot be configured with a negative value."));
1380+
return InitError(Untranslated("peertimeout must be a positive integer."));
13811381
}
13821382

13831383
if (args.IsArgSet("-minrelaytxfee")) {

src/random.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static void ReportHardwareRand()
9696
// This must be done in a separate function, as InitHardwareRand() may be indirectly called
9797
// from global constructors, before logging is initialized.
9898
if (g_rdseed_supported) {
99-
LogPrintf("Using RdSeed as additional entropy source\n");
99+
LogPrintf("Using RdSeed as an additional entropy source\n");
100100
}
101101
if (g_rdrand_supported) {
102102
LogPrintf("Using RdRand as an additional entropy source\n");

test/functional/p2p_compactblocks.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,15 @@ def test_getblocktxn_handler(self, test_node):
561561
assert_equal(test_node.last_message["block"].block.sha256, int(block_hash, 16))
562562
assert "blocktxn" not in test_node.last_message
563563

564+
# Request with out-of-bounds tx index results in disconnect
565+
bad_peer = self.nodes[0].add_p2p_connection(TestP2PConn(cmpct_version=1))
566+
block_hash = node.getblockhash(chain_height)
567+
block = FromHex(CBlock(), node.getblock(block_hash, False))
568+
msg.block_txn_request = BlockTransactionsRequest(int(block_hash, 16), [len(block.vtx)])
569+
with node.assert_debug_log(['getblocktxn with out-of-bounds tx indices']):
570+
bad_peer.send_message(msg)
571+
bad_peer.wait_for_disconnect()
572+
564573
def test_compactblocks_not_at_tip(self, test_node):
565574
node = self.nodes[0]
566575
# Test that requesting old compactblocks doesn't work.

test/functional/p2p_permissions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def run_test(self):
100100
self.nodes[1].assert_start_raises_init_error(["[email protected]"], "Invalid P2P permission", match=ErrorMatch.PARTIAL_REGEX)
101101
self.nodes[1].assert_start_raises_init_error(["[email protected]:230"], "Invalid netmask specified in", match=ErrorMatch.PARTIAL_REGEX)
102102
self.nodes[1].assert_start_raises_init_error(["[email protected]/10"], "Cannot resolve -whitebind address", match=ErrorMatch.PARTIAL_REGEX)
103+
self.nodes[1].assert_start_raises_init_error(["[email protected]", "-bind=127.0.0.1", "-listen=0"], "Cannot set -bind or -whitebind together with -listen=0", match=ErrorMatch.PARTIAL_REGEX)
103104

104105
def check_tx_relay(self):
105106
block_op_true = self.nodes[0].getblock(self.nodes[0].generatetoaddress(100, ADDRESS_BCRT1_P2SH_OP_TRUE)[0])

test/functional/wallet_coinbase_category.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
class CoinbaseCategoryTest(BitcoinTestFramework):
1616
def set_test_params(self):
1717
self.num_nodes = 1
18+
self.setup_clean_chain = True
1819

1920
def skip_test_if_missing_module(self):
2021
self.skip_if_no_wallet()

0 commit comments

Comments
 (0)