File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,18 @@ FUZZ_TARGET(txorphan, .init = initialize_orphanage)
128
128
Assert (!have_tx || !add_tx);
129
129
}
130
130
},
131
+ [&] {
132
+ bool have_tx = orphanage.HaveTx (tx->GetWitnessHash ());
133
+ bool have_tx_and_peer = orphanage.HaveTxFromPeer (tx->GetWitnessHash (), peer_id);
134
+ // AddAnnouncer should return false if tx doesn't exist or we already HaveTxFromPeer.
135
+ {
136
+ bool added_announcer = orphanage.AddAnnouncer (tx->GetWitnessHash (), peer_id);
137
+ // have_tx == false -> added_announcer == false
138
+ Assert (have_tx || !added_announcer);
139
+ // have_tx_and_peer == true -> added_announcer == false
140
+ Assert (!have_tx_and_peer || !added_announcer);
141
+ }
142
+ },
131
143
[&] {
132
144
bool have_tx = orphanage.HaveTx (tx->GetWitnessHash ());
133
145
// EraseTx should return 0 if m_orphans doesn't have the tx
@@ -142,6 +154,7 @@ FUZZ_TARGET(txorphan, .init = initialize_orphanage)
142
154
},
143
155
[&] {
144
156
orphanage.EraseForPeer (peer_id);
157
+ Assert (!orphanage.HaveTxFromPeer (tx->GetWitnessHash (), peer_id));
145
158
},
146
159
[&] {
147
160
// test mocktime and expiry
You can’t perform that action at this time.
0 commit comments