summaryrefslogtreecommitdiff
path: root/20/7370e65aea255afa0e6933b75bc1a1c87b5e67
blob: 4aa6fa7860edaa4fa48e5dafe97da7325490e369 (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
Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193]
	helo=mx.sourceforge.net)
	by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
	(envelope-from <bitcoin-list@bluematt.me>) id 1QhMfP-0005rd-3f
	for bitcoin-development@lists.sourceforge.net;
	Thu, 14 Jul 2011 14:13:27 +0000
Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of bluematt.me
	designates 208.79.240.5 as permitted sender)
	client-ip=208.79.240.5; envelope-from=bitcoin-list@bluematt.me;
	helo=smtpauth.rollernet.us; 
Received: from smtpauth.rollernet.us ([208.79.240.5])
	by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256)
	(Exim 4.76) id 1QhMfM-00060C-MA
	for bitcoin-development@lists.sourceforge.net;
	Thu, 14 Jul 2011 14:13:27 +0000
Received: from smtpauth.rollernet.us (localhost [127.0.0.1])
	by smtpauth.rollernet.us (Postfix) with ESMTP id 1443259400E
	for <bitcoin-development@lists.sourceforge.net>;
	Thu, 14 Jul 2011 07:13:03 -0700 (PDT)
Received: from mail.bluematt.me (unknown
	[IPv6:2001:470:9ff2:2:20c:29ff:fe16:f239])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: @bluematt.me)
	by smtpauth.rollernet.us (Postfix) with ESMTPSA
	for <bitcoin-development@lists.sourceforge.net>;
	Thu, 14 Jul 2011 07:12:59 -0700 (PDT)
Received: from [IPv6:2001:470:9ff2:1:2c0:caff:fe33:858b] (unknown
	[IPv6:2001:470:9ff2:1:2c0:caff:fe33:858b])
	by mail.bluematt.me (Postfix) with ESMTPSA id 4C913B420
	for <bitcoin-development@lists.sourceforge.net>;
	Thu, 14 Jul 2011 16:13:05 +0200 (CEST)
From: Matt Corallo <bitcoin-list@bluematt.me>
To: bitcoin-development@lists.sourceforge.net
In-Reply-To: <CAJNQ0st6Fo+VgVWj-AA5x8EvetZt4H=PR=n5q6NhZ6RyR0HYOA@mail.gmail.com>
References: <CAJNQ0st6Fo+VgVWj-AA5x8EvetZt4H=PR=n5q6NhZ6RyR0HYOA@mail.gmail.com>
Content-Type: multipart/signed; micalg="pgp-sha1";
	protocol="application/pgp-signature";
	boundary="=-NV7sp+pSzgLcnfNPqc+r"
Date: Thu, 14 Jul 2011 16:13:04 +0200
Message-ID: <1310652784.2284.192.camel@Desktop666>
Mime-Version: 1.0
X-Mailer: Evolution 2.32.2 
X-Rollernet-Abuse: Processed by Roller Network Mail Services. Contact
	abuse@rollernet.us to report violations. Abuse policy:
	http://rollernet.us/abuse.php
X-Rollernet-Submit: Submit ID 3815.4e1ef96b.c8d3e.0
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_HELO_PASS          SPF: HELO matches SPF record
	-0.0 SPF_PASS               SPF: sender matches SPF record
X-Headers-End: 1QhMfM-00060C-MA
Subject: Re: [Bitcoin-development] Notifications from client/wallet
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, 14 Jul 2011 14:13:27 -0000


--=-NV7sp+pSzgLcnfNPqc+r
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

This sounds cool, I started implementing the other half of this a couple
days ago.  My broad idea of a source cleanup (that sipa largely wrote)
is to have a central notification interface which wallet(s)/net/block
store/etc all communicate with, and then an interface, like the one
proposed here, which GUI/RPC/etc use to communicate with wallet/net.
This should allow for very clean separation of pieces and large-scale
rewrites of one or another part (or drop-in replacements) without
touching anything but the parts that are being redone.  This should also
allow for cool programs (like pushpoold/a block notification server/etc)
to use Bitcoin as a library fairly efficiently.

Matt

On Thu, 2011-07-14 at 05:19 +0000, John Smith wrote:
> Hello all,
>=20
> I'd like to add notifications to the client and wallet, to decouple UI
> and core communication, and especially so that UIs no longer have to
> poll for changes.=20
>=20
> I propose to use the boost::signal mechanism for that. It is basically
> a glorified callback system, but allows decoupled delivery of
> 'signals' from an object. Multiple other objects can listen in on an
> event without the emitting object having to care.=20
>=20
> Wallet:
>=20
> class CWallet { ...
>     boost::signal<void(int64)> balanceChanged;
> }
>=20
>=20
> void CWallet::newTx (...) {
>=20
>     ...
>     balanceChanged(new_balance);
>     ...
> }
>=20
>=20
>=20
> UI:
>=20
> GUI::GUI(CWallet *wallet) {
>    ...
>    wallet->balanceChanged.connect(boost::bind(&GUI::balanceChanged,
> this, _1));
> }
> GUI::balanceChanged(int64 new_balance) {
>    someWidget->setValue(new_balance);
> }
>=20
>=20
> Specific notifications that would be useful:
>=20
> Wallet:
>       * balanceChanged(int64): spendable balance changed
>       * transactionAdded(int256): new transaction added to wallet
>       * transactionUpdated(int256): transaction info changed
>       * transactionRemoved(int256): transaction removed from wallet
>         (can this happen? for completeness)
>       * addressAdded(int160): address was added to address book
>       * addressUpdated(int160): address label/other metadata was
>         modified
>       * addressRemoved(int160): address was removed from address book
>       * notification(std::string message, int severity): warning/error
>         occured in wallet processing, notify user
>       * int askFee(std::string message, ...): ask user for fee
> Network client:
>       * numConnectionsChanged(int): new connections / connections
>         broken
>       * numBlocksChanged(int): new blocks came in or other changes to
>         block chain
>       * notification(std::string message, int severity): warning/error
>         occured in network processing, notify user
>=20
> JS

--=-NV7sp+pSzgLcnfNPqc+r
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAABAgAGBQJOHvlnAAoJEBrh01BD4I5UePEP/3UufxZXec2JWsoj1J6h0FKH
xPAvsSJQetK7X4S50CYuSydTU9l/wORE6tcsYjsG6RZQvceaWZ1YKT0MDxiOcG/w
TH1F7AycUsVh8kDED9wZAnEMsqFlZaqbJ2UJ8718eaE9ZUx+Za/iJkAWHfNHyMNF
LqqSiUAdHcm6z7g/+1D8sLPrpe+ePSrpyA8z+Vql3tXYjShgJ3a/Po+VmToW3Fr2
fhVt5gxeoXGPIsDNvSpE6f865hM9LUN1zzb7v5MJBf94zmLAtGnfEMag7TXJpN5m
J/iOjb9Blo917eeJ6YBAjkO8Yqufl5XPhz2g6iCyTdm1IFwvTowORLezfd1/ipxP
YBOCSfLuGeAGGNge6X/vOp6IQDbgBQWkPzSweMr7rlZ3XLGlibAt9aqbKyn/OU8I
IIznbobKLnD6HDrL9FnppXyiZEjASRF0pjdfsVLq84g6vYkBXmrtBUMHiqqP0DH6
0KfQVdNVIHxYziTo2otiTD+G4MjVA8VZ9rYUhZvibnrugpsOYmNSkAby+7YQVPNC
aaHWrvkG3fgT058DJ3iZs+CUImuxVSclFza8Tx+pH3r5weL1J+nuDQEn8gMn/dPr
Zpp5Xivcv5Vizb+Fyb4XecxHPipLwfHKnRXzG9UMX8mmh23gyHaN7WQnMAp1Q6cX
31RJTmNf92Ctfbdy/GsH
=3kwJ
-----END PGP SIGNATURE-----

--=-NV7sp+pSzgLcnfNPqc+r--