summaryrefslogtreecommitdiff
path: root/9b/ddf3fed3aa7ec26390009e533d82c6f6eb8da4
blob: 77338c5fe69bf2a83354e0d5179cd1ef81e8aa91 (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
Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193]
	helo=mx.sourceforge.net)
	by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
	(envelope-from <pete@petertodd.org>) id 1YLoSg-0001sF-3f
	for bitcoin-development@lists.sourceforge.net;
	Thu, 12 Feb 2015 07:45:22 +0000
Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of petertodd.org
	designates 62.13.148.114 as permitted sender)
	client-ip=62.13.148.114; envelope-from=pete@petertodd.org;
	helo=outmail148114.authsmtp.net; 
Received: from outmail148114.authsmtp.net ([62.13.148.114])
	by sog-mx-3.v43.ch3.sourceforge.com with esmtp (Exim 4.76)
	id 1YLoSe-0006RO-Si for bitcoin-development@lists.sourceforge.net;
	Thu, 12 Feb 2015 07:45:22 +0000
Received: from mail-c235.authsmtp.com (mail-c235.authsmtp.com [62.13.128.235])
	by punt16.authsmtp.com (8.14.2/8.14.2/) with ESMTP id t1C7jDRi078730;
	Thu, 12 Feb 2015 07:45:13 GMT
Received: from savin.petertodd.org (75-119-251-161.dsl.teksavvy.com
	[75.119.251.161]) (authenticated bits=128)
	by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id t1C7j9sp043212
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO);
	Thu, 12 Feb 2015 07:45:12 GMT
Date: Thu, 12 Feb 2015 02:45:09 -0500
From: Peter Todd <pete@petertodd.org>
To: Tamas Blummer <tamas@bitsofproof.com>
Message-ID: <20150212074509.GC4254@savin.petertodd.org>
References: <20150212064719.GA6563@savin.petertodd.org>
	<7C171F0B-1EF8-4542-8E18-187B2E94DF14@bitsofproof.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="5G06lTa6Jq83wMTw"
Content-Disposition: inline
In-Reply-To: <7C171F0B-1EF8-4542-8E18-187B2E94DF14@bitsofproof.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Server-Quench: 138885c0-b28b-11e4-b396-002590a15da7
X-AuthReport-Spam: If SPAM / abuse - report it at:
	http://www.authsmtp.com/abuse
X-AuthRoute: OCd2Yg0TA1ZNQRgX IjsJECJaVQIpKltL GxAVKBZePFsRUQkR
	aAdMdwAUHlAWAgsB AmMbW1NeVFh7WGE7 bA9PbARUfEhLXhtr
	VklWR1pVCwQmRR1y AUQXEVlycwZEeXw+ bEBiVz5aX0xyfUMu
	QlMGF2VUeGZhPWQC AkNRcR5UcAFPdx8U a1UrBXRDAzANdhES
	HhM4ODE3eDlSNilR RRkIIFQOdA4REyY4 ThsPWD8+WEMISm0t
	d1p/chhEBk1NWgAA 
X-Authentic-SMTP: 61633532353630.1023:706
X-AuthFastPath: 0 (Was 255)
X-AuthSMTP-Origin: 75.119.251.161/587
X-AuthVirus-Status: No virus detected - but ensure you scan with your own
	anti-virus system.
X-Spam-Score: -1.5 (-)
X-Spam-Report: Spam Filtering performed by mx.sourceforge.net.
	See http://spamassassin.org/tag/ for more details.
	-1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for
	sender-domain
	-0.0 SPF_PASS               SPF: sender matches SPF record
X-Headers-End: 1YLoSe-0006RO-Si
Cc: bitcoin-development@lists.sourceforge.net
Subject: Re: [Bitcoin-development] replace-by-fee v0.10.0rc4
X-BeenThere: bitcoin-development@lists.sourceforge.net
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <bitcoin-development.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development>
List-Post: <mailto:bitcoin-development@lists.sourceforge.net>
List-Help: <mailto:bitcoin-development-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=subscribe>
X-List-Received-Date: Thu, 12 Feb 2015 07:45:22 -0000


--5G06lTa6Jq83wMTw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Feb 12, 2015 at 08:23:29AM +0100, Tamas Blummer wrote:
> Peter,
>=20
> An important use of the core is being border router to proprietary softwa=
re, that is usually indexing the block chain and mempool. That software is =
also assuming that double spends are not relayed by the core.
>=20
> 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 jus=
t fee comparison, would have to be replicated in the proprietary stack and =
mempool might get out of sync with that of the border router.=20

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=3DTrue)
    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.

--=20
'peter'[:-1]@petertodd.org
00000000000000000948f5c1f1a8c8073cc7d5161b98474e33904f8a1d6b0330

--5G06lTa6Jq83wMTw
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature

-----BEGIN PGP SIGNATURE-----

iQGrBAEBCACVBQJU3FoBXhSAAAAAABUAQGJsb2NraGFzaEBiaXRjb2luLm9yZzAw
MDAwMDAwMDAwMDAwMDAwODc4ZTllOWUwOTFlZjgzNjBiZjcxMGMxOGFmYjQzODRl
MGJjM2NlZTc0YmQ1NzIvFIAAAAAAFQARcGthLWFkZHJlc3NAZ251cGcub3JncGV0
ZUBwZXRlcnRvZC5vcmcACgkQJIFAPaXwkfsQIQf+NgiN0zVef4vyWRhOzkqC7D2x
juHVENDq5+TZIbgnCA7QOK24sr695nTrwkS4chSDaaigulObShE2MffBDfJAQ6oB
bQV48riuEyzfEasm+7nm0730FP8L4vFldd/KD0p1XN95uTHSlPP3WHaS4EkmO2AD
g+ZJBP+eOLhpw0iq9A1XTPkcImFXBSJTY3TymTRdcTLuibtzwvqWZ3/ejZ8ALROb
fWausmxF/f/D8x0QHEAE+PZ7Hz9TqmvycvUOYO84ORU5sbp+NqlKZqHx++mt6FbQ
1+ilhe2UY9JmQUwi5npgUQF5Hc+3U5n0fuLFRlDgD+/lEJYyplBXPEUOHiBRzg==
=FAew
-----END PGP SIGNATURE-----

--5G06lTa6Jq83wMTw--