What is Nostr?
Peter Todd [ARCHIVE] /
npub1m23ā€¦2np2
2023-06-07 15:30:07
in reply to nevent1qā€¦27kh

Peter Todd [ARCHIVE] on Nostr: šŸ“… Original date posted:2015-02-12 šŸ“ Original message:On Thu, Feb 12, 2015 at ...

šŸ“… Original date posted:2015-02-12
šŸ“ Original message:On Thu, Feb 12, 2015 at 08:23:29AM +0100, Tamas Blummer wrote:
> Peter,
>
> An important use of the core is being border router to proprietary software, that is usually indexing the block chain and mempool. That software is also assuming that double spends are not relayed by the core.
>
> To remain useful as border router, the replace-by-fee patched core should only relay double spend if it actually replaces an earlier transaction, as otherwise the replace logic that is according to your commit more than just fee comparison, would have to be replicated in the proprietary stack and mempool might get out of sync with that of the border router.

Absolutely nothing in the replace-by-fee patch is consensus critical;
your objection is entirely an artifact of the poor modularity of the
Bitcoin Core codebase, something that is being actively improved on as
we speak.

Anyway, the logic of dealing with double-spends and keeping mempools
synced is pretty trivial:

for i in range(len(tx.vout)):
for double_spent_tx in mempool.mapNextTx[COutPoint(tx.GetHash(), i)]:
mempool.remove(double_spent_tx, recursive=True)
mempool.add(tx)

IOW, assume every transaction your "border router" gives you is now the
one and only true transaction, and everything conflicting with it must
go.

All the complexity of replace-by-fee is in deciding when one transaction
should replace another(s). Other than that the code is simple and very
similar to block handling logic.

--
'peter'[:-1]@petertodd.org
00000000000000000948f5c1f1a8c8073cc7d5161b98474e33904f8a1d6b0330
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 650 bytes
Desc: Digital signature
URL: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20150212/b1db0155/attachment.sig>;
Author Public Key
npub1m230cem2yh3mtdzkg32qhj73uytgkyg5ylxsu083n3tpjnajxx4qqa2np2