{"type":"rich","version":"1.0","author_name":"npub1m230cem2yh3mtdzkg32qhj73uytgkyg5ylxsu083n3tpjnajxx4qqa2np2","author_url":"https://nostr.ae/npub1m230cem2yh3mtdzkg32qhj73uytgkyg5ylxsu083n3tpjnajxx4qqa2np2","provider_name":"njump","provider_url":"https://nostr.ae","html":"📅 Original date posted:2015-02-12\n📝 Original message:On Thu, Feb 12, 2015 at 08:23:29AM +0100, Tamas Blummer wrote:\n\u003e Peter,\n\u003e \n\u003e 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.\n\u003e \n\u003e 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. \n\nAbsolutely nothing in the replace-by-fee patch is consensus critical;\nyour objection is entirely an artifact of the poor modularity of the\nBitcoin Core codebase, something that is being actively improved on as\nwe speak.\n\nAnyway, the logic of dealing with double-spends and keeping mempools\nsynced is pretty trivial:\n\n    for i in range(len(tx.vout)):\n        for double_spent_tx in mempool.mapNextTx[COutPoint(tx.GetHash(), i)]:\n            mempool.remove(double_spent_tx, recursive=True)\n    mempool.add(tx)\n\nIOW, assume every transaction your \"border router\" gives you is now the\none and only true transaction, and everything conflicting with it must\ngo.\n\nAll the complexity of replace-by-fee is in deciding when one transaction\nshould replace another(s). Other than that the code is simple and very\nsimilar to block handling logic.\n\n-- \n'peter'[:-1]@petertodd.org\n00000000000000000948f5c1f1a8c8073cc7d5161b98474e33904f8a1d6b0330\n-------------- next part --------------\nA non-text attachment was scrubbed...\nName: signature.asc\nType: application/pgp-signature\nSize: 650 bytes\nDesc: Digital signature\nURL: \u003chttp://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20150212/b1db0155/attachment.sig\u003e"}
