summaryrefslogtreecommitdiff
path: root/54/4c64639d8802891983864d062c0ba88de540fc
blob: 0a63b81405357a792485fc1dd0a099cdc1bf9504 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
Return-Path: <willtech@live.com.au>
Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])
 by lists.linuxfoundation.org (Postfix) with ESMTP id 19021C000A
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 29 Nov 2021 14:10:19 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by smtp3.osuosl.org (Postfix) with ESMTP id 01C4B6065F
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 29 Nov 2021 14:10:19 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level: 
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5
 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from smtp3.osuosl.org ([127.0.0.1])
 by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id Xn-TJOejaORK
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 29 Nov 2021 14:10:17 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.8.0
Received: from KOR01-PS2-obe.outbound.protection.outlook.com
 (mail-ps2kor01olkn0800.outbound.protection.outlook.com
 [IPv6:2a01:111:f400:fead::800])
 by smtp3.osuosl.org (Postfix) with ESMTPS id DB5E06062B
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 29 Nov 2021 14:10:15 +0000 (UTC)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ORhxs44/L6K+XseCTyAQYGcVo8Gb90fkAr+sTEmOVgI1jE2Jfmql9BvVnredg92V2wpHdPffGdrtS7UpCOKMgPNqj2otvL9j7uC/6DwsmDRh9rkKMoMPNmHjzK609G4+skRXEJYMY9z2c69ZJarzroRFsNJYZI7GnQ9EuPbGhUM+GuKfHjpXbSt6UxAUpFmC015B1NsvO6TrDX/bqVFxoQ/X1fBlhaWnfRwDsjHg8Dtg6JX6/LspOa193lF+EZdkVMFr3HBaktDiEfy4xJN/3nuIvSaVIHWKLTIe2hkF2qmx9HnW4BCwinGNgV95rJ6vZNzw2cGwxNPHOR5uQ6xb6Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=pW9473JqNfSH4WgbjNI/diGpkdt05P0sPmApsC/T3GY=;
 b=eqXx6+Hzig183zFc/DoluhAUWwGeaDbBZCsw4sfe68OcpAUU1vkrPaRlslUTOmnhShLV8drR07gC3mCZXYmOxfpZb6gRhDzLa+2A/OME9f32yCIxmUhICVuBucXTWlGX65i5VnPKG/GKY6TMSmvPvth4od/99nutipv372Dq3mMC4+XqzkFjm90xrR1eGYvBE071MjOYj+x54f2hByRjnn8DAFLIMIeif9oXQBVGnFRfTjab2cDCnirs4nShhmghkgy5ywxr84bbQwxEVzWZFeArOZUalu7gJSiL7dw5jt6/aB2oLjUTDvUWjmL3HA/+zsw+1e/S3sE5PyvHtVdDPw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
Received: from PS2P216MB1089.KORP216.PROD.OUTLOOK.COM (2603:1096:301:52::11)
 by PU4P216MB1356.KORP216.PROD.OUTLOOK.COM (2603:1096:301:a2::11) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Mon, 29 Nov
 2021 14:10:11 +0000
Received: from PS2P216MB1089.KORP216.PROD.OUTLOOK.COM
 ([fe80::4c6c:a1dc:c8c0:fed2]) by PS2P216MB1089.KORP216.PROD.OUTLOOK.COM
 ([fe80::4c6c:a1dc:c8c0:fed2%3]) with mapi id 15.20.4734.024; Mon, 29 Nov 2021
 14:10:11 +0000
From: LORD HIS EXCELLENCY JAMES HRMH <willtech@live.com.au>
To: Ali Sherief <ali@notatether.com>, Bitcoin Protocol Discussion
 <bitcoin-dev@lists.linuxfoundation.org>, 0xB10C <0xb10c@gmail.com>
Thread-Topic: [bitcoin-dev] Trying to patch Core ZMQ "rawtx" topic to only
 publish unconfirmed transactions: How?
Thread-Index: AQHX5QYL3AFqJ1NPY0C53B0aDLTo/awaiuIc
Date: Mon, 29 Nov 2021 14:10:11 +0000
Message-ID: <PS2P216MB108925E1A218737486323FA19D669@PS2P216MB1089.KORP216.PROD.OUTLOOK.COM>
References: <i1UxLDIyGhAt1KS5mHXaZ1cjhjEDd1bwVm-GZjrCRpye8z4O9zuwkw1CNa_UER12p79KknIKbT5hjjW5e0hwV0fWlB0kag6mHAF5f8K1y2k=@notatether.com>
 <6dbaa89c-b658-e239-9f28-5f1609b8e746@gmail.com>
In-Reply-To: <6dbaa89c-b658-e239-9f28-5f1609b8e746@gmail.com>
Accept-Language: en-AU, en-US
Content-Language: en-AU
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
suggested_attachment_session_id: c02dd0a9-2f23-d713-203e-ece5cef35278
x-ms-exchange-messagesentrepresentingtype: 1
x-tmn: [j4yRbNZXDbkjlwLji6YsQcQituB5YbvV]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: dfad70af-950e-4813-7614-08d9b341f4d7
x-ms-traffictypediagnostic: PU4P216MB1356:
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: wCC1289guYx1QLgy7y6E12qiynyq6CqRqvUkPMtxuruxK41qXAD1/KMtdkb+Mpww7oPib/HUma2RcVOIuuBpgig3a/v2O+qmoqcZMz2ZQLGpMl8hxlvLNJjobpzWsNTFfLQP/4uS1pki/+iyTtO9SjJWeG/wJ74OAPMKULAh6wTytZ29eq1ZXfGeLSNo69NJNOojoguIay3fGtQiWya/iKHpUWkXH6yydwc2iFk74z1DA2F429jRtFLuWTee5uiVKhIELvgvkppHM2VP5UOqFPEBfmsIJ+wtyxyCMJ8alG6MlCuRpnCY6eiwzpH/aDP7bTlnhHJbfhsW0Kquk2iLTAulYAsEmilCqeKPAhIbFdIZFzS+b49LgXKmETXbYX6hlmRWOLgxjuwS3JeHi0POJ3+FkCoQXPyxVZE1pAF8JKbzwrA98DQSOn8+wS36RwDbU43CYAxYL1zjI48hBlZHvIq1xJlmsnJPUqp8jwEUGAIDOwLktFk1UINfabv1aPd7Y6Quxwe2SYXFOQBpw4DpbgAFhqUsgtMrOSfG6lvmzn0sNlnlVHvsqmWQ1mTgyG4NvVTHt3aTQS7wPOf++yddKruzTHDQ8nKmzO8tTKTWtebNiS6ht9jOD56H8TbHDv0QgxkgfsJobeRC2O0eJd/xx9fvA9kCjyyaY28+iN7HC4Y=
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: j1iyVPARQa8uDIYkDPE/SfKXBMdhwmnGeSTOffhjvKz4IaqdLB6ZFlJcJFgwmAcy5IjlgAICVLZijNlOAQ7JyYTN57NZD5jhKufLIwHQz1DbBz4keEAGDy8PS4dA6mgZCKvQLkEFVt6osq3HpRQ5IA5aV3DRxbDD/zGSwZigsldrp0VREkUn83qfUptg3ioNK9bWnfvdckhJmp6J+Gbspi/26Vy9AlzS3Tvr17VrAUXrhkj4r8Qo5r5P/vkSZvBgJj+RY+a2QsBbBuG4xTVA+1wpwBph3g/roEQtJreW/zbGqULgw4KkQ6V3P+aTncxXpyp5x0yCN1VUbpVAi1foN7YaZ31scaEOCSjr+7U8Z3rTRKSk5M3+Sa1/NUw/xk1ygimcheoU0b55zcvvm8mdjsQSppEswNrlQkz9REJX6LBGJ0eqrKx6IsUlHgd5y05lYJlJ/aFiCMVEpEvWotvAvdY+fbps3KiOzL5jCIWa58H4D6HjgDFpRtdYq/qbbvpM+EzZ4MOtdYgu4ccoPERFvtL4J87iqpd4GCjvFNsdiZ2ucWx9oBQe3MGJe7LVZuHrPDPlo2ctm+PM8Rgf1gvZ3LiZP0NopHCLINuYeIFKfbG0vvRdLHX7Gk3Ug8VZql7yxKFXSlY+MA4Iza/ktQ2JrR8bzNFQWbyxlYvDm6czKB4nXLltcKedf+9MNVDe7/FpHm1ZeHasp9F7Ly8iNndEWA==
Content-Type: multipart/alternative;
 boundary="_000_PS2P216MB108925E1A218737486323FA19D669PS2P216MB1089KORP_"
MIME-Version: 1.0
X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-af45a.templateTenant
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: PS2P216MB1089.KORP216.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-CrossTenant-Network-Message-Id: dfad70af-950e-4813-7614-08d9b341f4d7
X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Nov 2021 14:10:11.0767 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PU4P216MB1356
X-Mailman-Approved-At: Mon, 29 Nov 2021 14:21:38 +0000
Subject: Re: [bitcoin-dev] Trying to patch Core ZMQ "rawtx" topic to only
 publish unconfirmed transactions: How?
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Mon, 29 Nov 2021 14:10:19 -0000

--_000_PS2P216MB108925E1A218737486323FA19D669PS2P216MB1089KORP_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Wasn't this already not a problem because you can check if it was confirmed=
? The transaction is not finalised in the mempool it is just speculation of=
 a transaction, so it makes sense to emit when the transaction is confirmed=
.  Just already check..

> It appears that the ZeroMQ topic I'm listening to, "rawtx", not only
> emits a raw transaction when it appears on the mempool, but once it's
> already confirmed too.

KING JAMES HRMH
Great British Empire

Regards,
The Australian
LORD HIS EXCELLENCY JAMES HRMH (& HMRH)
of Hougun Manor & Glencoe & British Empire
MR. Damian A. James Williamson
Wills

et al.


Willtech
www.willtech.com.au
www.go-overt.com
duigco.org DUIGCO API
and other projects


m. 0487135719
f. +61261470192


This email does not constitute a general advice. Please disregard this emai=
l if misdelivered.
________________________________
From: bitcoin-dev <bitcoin-dev-bounces@lists.linuxfoundation.org> on behalf=
 of 0xB10C via bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org>
Sent: Monday, 29 November 2021 8:32 PM
To: Ali Sherief <ali@notatether.com>; Bitcoin Protocol Discussion <bitcoin-=
dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] Trying to patch Core ZMQ "rawtx" topic to only p=
ublish unconfirmed transactions: How?

Hi Ali,

I've run into this multiple times myself. I've opened a draft PR [0]
adding a rawmempooltx publisher.

You're right. In zmq/zmqnotificationinterface.cpp the
CZMQNotificationInterface is notified about TransactionAddedToMempool.
Currently, this calls NotifyTransaction() (the publisher with the rawtx
topic) and NotifyTransactionAcceptance() (the publisher with the
sequence topic)[1]. I've added a call to a new
NotifyMempoolTransaction() function (the publisher with the rawmempooltx
topic).

I'd find a mempool transaction publisher with both the raw transaction
and transaction fee useful too. However, this requires changes to the
chain notifications in interfaces/chain.h.

[0]: https://github.com/bitcoin/bitcoin/pull/23624
[1]:
https://github.com/bitcoin/bitcoin/pull/23624/files#diff-ac4b2d3a8de2c4dd41=
ad9d75505ea6ce4dc87a476710a9ebee8acf9bebf5cca2L146-L148


Best,
0xB10C



On 11/26/21 5:56 PM, Ali Sherief via bitcoin-dev wrote:
>
> This has also been posted on Bitcointalk
> forum: https://bitcointalk.org/index.php?topic=3D5373341.msg58539261#msg5=
8539261
> <https://bitcointalk.org/index.php?topic=3D5373341.msg58539261#msg5853926=
1> I
> have republished it here hoping someone more knowledgeable can post
> some insight about this.
> ----
> It appears that the ZeroMQ topic I'm listening to, "rawtx", not only
> emits a raw transaction when it appears on the mempool, but once it's
> already confirmed too.
>
> This messes with my software, causing it to add txids, addresses, etc.
> a second time inside arrays (this means that the same transaction is
> received twice in total).
>
> Array de-duping is not a viable solution long-term (because the array
> will quickly grow to be big eventually and then this has to happen
> every time a new element is added), so I'm trying to nip the problem
> from the source by instructing Core to only publish unconfirmed
> bitcoin transactions.
>
> According to
> https://bitcoin.stackexchange.com/questions/52848/is-it-possible-to-confi=
gure-the-bitcoin-daemon-to-only-broadcast-unconfirmed-tra
> <https://bitcoin.stackexchange.com/questions/52848/is-it-possible-to-conf=
igure-the-bitcoin-daemon-to-only-broadcast-unconfirmed-tra>
> , it is not possible to configure this from a configuration or
> command-line option. The source code must directly be edited. But
> since the codebase has changed greatly, the proposed solution no
> longer works.
>
> ----
>
> So basically, I know that something inside
> src/zmq/zmqnotificationinterface.cpp needs to be patched, but I'm not
> sure which function, or how to do it. Because I only need unconfirmed
> transactions to be published on ZeroMQ rawtx and not confirmed ones,
> it's one of the following functions that I need to patch for my own build=
:
>
> CZMQNotificationInterface::TransactionRemovedFromMempool
> void CZMQNotificationInterface::BlockDisconnected
>
> Both of these call NotifyTransaction() method which I assume fires a
> message on "rawtx" channel.
>
> In the Stack Exchange question I linked above, Jonas Schnelli
> suggested adding an `if (!pblock)` check, but that was several years
> ago and the function he was referencing no longer exists.
>
> But I still wonder if the pblock check is still applicable in the
> present day (i.e. if it's indicating a block the transaction is inside).
>
> - Ali Sherief
>
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev


_______________________________________________
bitcoin-dev mailing list
bitcoin-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev

--_000_PS2P216MB108925E1A218737486323FA19D669PS2P216MB1089KORP_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
Wasn't this already not a problem because you can check if it was confirmed=
? The transaction is not finalised in the mempool it is just speculation of=
 a transaction, so it makes sense to emit when the transaction is confirmed=
.&nbsp; Just already check..<br>
</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
<font size=3D"2"><span style=3D"font-size:11pt">&gt; It appears that the Ze=
roMQ topic I'm listening to, &quot;rawtx&quot;, not only<br>
&gt; emits a raw transaction when it appears on the mempool, but once it's<=
br>
&gt; already confirmed too.</span></font><br>
</div>
<div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
<br>
</div>
<div id=3D"Signature">
<div>
<div></div>
<div></div>
<div></div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif; font-size:12pt; col=
or:rgb(0,0,0)">
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif; font-size:12pt; col=
or:rgb(0,0,0)">
<div>KING JAMES HRMH</div>
<div>Great British Empire</div>
<div><br>
</div>
<div>Regards,
<div>The Australian</div>
<div>LORD HIS EXCELLENCY JAMES HRMH (&amp; HMRH)</div>
<div>of Hougun Manor &amp; Glencoe &amp; British Empire</div>
<div>MR. Damian A. James Williamson</div>
<div>Wills</div>
<div><br>
</div>
<div>et al.</div>
<div><br>
</div>
<div>&nbsp;</div>
<div>Willtech</div>
<div>www.willtech.com.au</div>
<div>www.go-overt.com</div>
<div>duigco.org DUIGCO API</div>
<div>and other projects</div>
<div>&nbsp;</div>
<div><br>
</div>
<div>m. 0487135719</div>
<div>f. +61261470192</div>
<div><br>
</div>
<div><br>
</div>
This email does not constitute a general advice. Please disregard this emai=
l if misdelivered.<br>
</div>
</div>
</div>
</div>
</div>
<div>
<hr tabindex=3D"-1" style=3D"display:inline-block; width:98%">
<div id=3D"divRplyFwdMsg" dir=3D"ltr"><font style=3D"font-size:11pt" face=
=3D"Calibri, sans-serif" color=3D"#000000"><b>From:</b> bitcoin-dev &lt;bit=
coin-dev-bounces@lists.linuxfoundation.org&gt; on behalf of 0xB10C via bitc=
oin-dev &lt;bitcoin-dev@lists.linuxfoundation.org&gt;<br>
<b>Sent:</b> Monday, 29 November 2021 8:32 PM<br>
<b>To:</b> Ali Sherief &lt;ali@notatether.com&gt;; Bitcoin Protocol Discuss=
ion &lt;bitcoin-dev@lists.linuxfoundation.org&gt;<br>
<b>Subject:</b> Re: [bitcoin-dev] Trying to patch Core ZMQ &quot;rawtx&quot=
; topic to only publish unconfirmed transactions: How?</font>
<div>&nbsp;</div>
</div>
<div class=3D"BodyFragment"><font size=3D"2"><span style=3D"font-size:11pt"=
>
<div class=3D"PlainText">Hi Ali,<br>
<br>
I've run into this multiple times myself. I've opened a draft PR [0]<br>
adding a rawmempooltx publisher.<br>
<br>
You're right. In zmq/zmqnotificationinterface.cpp the<br>
CZMQNotificationInterface is notified about TransactionAddedToMempool.<br>
Currently, this calls NotifyTransaction() (the publisher with the rawtx<br>
topic) and NotifyTransactionAcceptance() (the publisher with the<br>
sequence topic)[1]. I've added a call to a new<br>
NotifyMempoolTransaction() function (the publisher with the rawmempooltx<br=
>
topic).<br>
<br>
I'd find a mempool transaction publisher with both the raw transaction<br>
and transaction fee useful too. However, this requires changes to the<br>
chain notifications in interfaces/chain.h.&nbsp;<br>
<br>
[0]: <a href=3D"https://github.com/bitcoin/bitcoin/pull/23624">https://gith=
ub.com/bitcoin/bitcoin/pull/23624</a><br>
[1]:<br>
<a href=3D"https://github.com/bitcoin/bitcoin/pull/23624/files#diff-ac4b2d3=
a8de2c4dd41ad9d75505ea6ce4dc87a476710a9ebee8acf9bebf5cca2L146-L148">https:/=
/github.com/bitcoin/bitcoin/pull/23624/files#diff-ac4b2d3a8de2c4dd41ad9d755=
05ea6ce4dc87a476710a9ebee8acf9bebf5cca2L146-L148</a>&nbsp;<br>
<br>
<br>
Best,<br>
0xB10C<br>
<br>
<br>
<br>
On 11/26/21 5:56 PM, Ali Sherief via bitcoin-dev wrote:<br>
&gt;<br>
&gt; This has also been posted on Bitcointalk<br>
&gt; forum:&nbsp;<a href=3D"https://bitcointalk.org/index.php?topic=3D53733=
41.msg58539261#msg58539261">https://bitcointalk.org/index.php?topic=3D53733=
41.msg58539261#msg58539261</a><br>
&gt; &lt;<a href=3D"https://bitcointalk.org/index.php?topic=3D5373341.msg58=
539261#msg58539261">https://bitcointalk.org/index.php?topic=3D5373341.msg58=
539261#msg58539261</a>&gt;&nbsp;I<br>
&gt; have republished it here hoping someone more knowledgeable can post<br=
>
&gt; some insight about this.<br>
&gt; ----<br>
&gt; It appears that the ZeroMQ topic I'm listening to, &quot;rawtx&quot;, =
not only<br>
&gt; emits a raw transaction when it appears on the mempool, but once it's<=
br>
&gt; already confirmed too.<br>
&gt;<br>
&gt; This messes with my software, causing it to add txids, addresses, etc.=
<br>
&gt; a second time inside arrays (this means that the same transaction is<b=
r>
&gt; received twice in total).<br>
&gt;<br>
&gt; Array de-duping is not a viable solution long-term (because the array<=
br>
&gt; will quickly grow to be big eventually and then this has to happen<br>
&gt; every time a new element is added), so I'm trying to nip the problem<b=
r>
&gt; from the source by instructing Core to only publish unconfirmed<br>
&gt; bitcoin transactions.<br>
&gt;<br>
&gt; According to<br>
&gt; <a href=3D"https://bitcoin.stackexchange.com/questions/52848/is-it-pos=
sible-to-configure-the-bitcoin-daemon-to-only-broadcast-unconfirmed-tra">
https://bitcoin.stackexchange.com/questions/52848/is-it-possible-to-configu=
re-the-bitcoin-daemon-to-only-broadcast-unconfirmed-tra</a><br>
&gt; &lt;<a href=3D"https://bitcoin.stackexchange.com/questions/52848/is-it=
-possible-to-configure-the-bitcoin-daemon-to-only-broadcast-unconfirmed-tra=
">https://bitcoin.stackexchange.com/questions/52848/is-it-possible-to-confi=
gure-the-bitcoin-daemon-to-only-broadcast-unconfirmed-tra</a>&gt;<br>
&gt; , it is not possible to configure this from a configuration or<br>
&gt; command-line option. The source code must directly be edited. But<br>
&gt; since the codebase has changed greatly, the proposed solution no<br>
&gt; longer works.<br>
&gt;<br>
&gt; ----<br>
&gt;<br>
&gt; So basically, I know that something inside<br>
&gt; src/zmq/zmqnotificationinterface.cpp needs to be patched, but I'm not<=
br>
&gt; sure which function, or how to do it. Because I only need unconfirmed<=
br>
&gt; transactions to be published on ZeroMQ rawtx and not confirmed ones,<b=
r>
&gt; it's one of the following functions that I need to patch for my own bu=
ild:<br>
&gt;<br>
&gt; CZMQNotificationInterface::TransactionRemovedFromMempool<br>
&gt; void CZMQNotificationInterface::BlockDisconnected<br>
&gt;<br>
&gt; Both of these call NotifyTransaction() method which I assume fires a<b=
r>
&gt; message on &quot;rawtx&quot; channel.<br>
&gt;<br>
&gt; In the Stack Exchange question I linked above,&nbsp;Jonas Schnelli<br>
&gt; suggested adding an `if (!pblock)` check, but that was several years<b=
r>
&gt; ago and the function he was referencing no longer exists.<br>
&gt;<br>
&gt; But I still wonder if the pblock check is still applicable in the<br>
&gt; present day (i.e. if it's indicating a block the transaction is inside=
).<br>
&gt;<br>
&gt; - Ali Sherief<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; bitcoin-dev mailing list<br>
&gt; bitcoin-dev@lists.linuxfoundation.org<br>
&gt; <a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-=
dev">https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
<br>
<br>
_______________________________________________<br>
bitcoin-dev mailing list<br>
bitcoin-dev@lists.linuxfoundation.org<br>
<a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev">=
https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
</div>
</span></font></div>
</div>
</body>
</html>

--_000_PS2P216MB108925E1A218737486323FA19D669PS2P216MB1089KORP_--