TraceRouter / bitcoinsharp

Automatically exported from code.google.com/p/bitcoinsharp
Apache License 2.0
0 stars 0 forks source link

Wallet Serialization Exception #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create wallet
2. Wire CoinsRecieved event handler
3. Save wallet

What is the expected output? What do you see instead?
The wallet should save to disk. Instead, a SerializationException is thrown.

Please provide any additional information below.

Apparently, if you have a Serializable class with event handlers, 
BinaryFormatter will try to serialize the handling classes unless you 
specifically mark them as NonSerialized. The easy fix is to add the following 
attribute to all Serializable class events:

[field: NonSerialized()]

I'd submit a patch but I'm not sure how to do that. :)

Original issue reported on code.google.com by chrisr...@gmail.com on 1 Jul 2011 at 8:42