Skip to content

Commit 063c132

Browse files
committed
[functional test] getorphantxs reflects multiple announcers
1 parent 0da693f commit 063c132

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/functional/rpc_orphans.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
ORPHAN_TX_EXPIRE_TIME,
1111
tx_in_orphanage,
1212
)
13-
from test_framework.messages import msg_tx
13+
from test_framework.messages import (
14+
CInv,
15+
msg_inv,
16+
msg_tx,
17+
MSG_WTX,
18+
)
1419
from test_framework.p2p import P2PInterface
1520
from test_framework.util import (
1621
assert_equal,
@@ -106,13 +111,19 @@ def test_orphan_details(self):
106111

107112
self.log.info("Check that orphan 1 and 2 were from different peers")
108113
assert orphanage[0]["from"][0] != orphanage[1]["from"][0]
114+
peer_ids = [orphanage[0]["from"][0], orphanage[1]["from"][0]]
109115

110116
self.log.info("Unorphan child 2")
111117
peer_2.send_and_ping(msg_tx(tx_parent_2["tx"]))
112118
assert not tx_in_orphanage(node, tx_child_2["tx"])
113119

120+
self.log.info("Check that additional announcers are reflected in RPC result")
121+
peer_2.send_and_ping(msg_inv([CInv(t=MSG_WTX, h=int(tx_child_1["wtxid"], 16))]))
122+
123+
orphanage = node.getorphantxs(verbosity=2)
124+
assert_equal(set(orphanage[0]["from"]), set(peer_ids))
125+
114126
self.log.info("Checking orphan details")
115-
orphanage = node.getorphantxs(verbosity=1)
116127
assert_equal(len(node.getorphantxs()), 1)
117128
orphan_1 = orphanage[0]
118129
self.orphan_details_match(orphan_1, tx_child_1, verbosity=1)

0 commit comments

Comments
 (0)