rnicoll / cate

Cross-chain Atomic Transaction Engine
MIT License
34 stars 19 forks source link

Own signature for refund transaction is invalid #3

Closed bushido closed 9 years ago

bushido commented 9 years ago

python 4_send_coins_a.py Traceback (most recent call last): File "4_send_coins_a.py", line 113, in response = process_offer_confirmed(confirmation, audit) File "4_send_coins_a.py", line 60, in process_offer_confirmed raise TradeError("Own signature for refund transaction is invalid.") cate.error.TradeError: 'Own signature for refund transaction is invalid.

rnicoll commented 9 years ago

Odd... just tried this myself, found some other issues but not this at least. What version of Python are you using?

Might be worth simply coming back to this once all my commits to python-bitcoinlib are merged in, things should be a little cleaner then. Meanwhile I'll try to get a unit test for this specifically.

bushido commented 9 years ago

Python 2.7.9 Ubuntu 14.04 LTS Linux ubuntu 3.13.0-39-generic #66-Ubuntu SMP Tue Oct 28 13:30:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

bushido commented 9 years ago

May I know your environment ? Python 2 or 3 ?

rnicoll commented 9 years ago

Python 2.7.6 Linux ubuntu 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

So, very close. Wondering if this might be an OpenSSL version change actually, I know 1.0.1k introduced much more careful checks. The previous version of the code used the signature including the signature type byte that's appended afterwards; I've updated it to strip that before verifying the signature. You'll need the latest version of python-altcoinlib (there's a function name change) as well, but can you try that now?

Probably quickest to run the unit tests first:

python -m unittest discover

bushido commented 9 years ago

I tested with another vm, it's working. I think it may be because of python version or the way that I installed python.

rnicoll commented 9 years ago

Glad you've got it working at least on one system; I'd like to come back to this once we have the various supporting libraries stabler, as it's easier to track down any subtle incompatibilities before attempting wider deployment.