chris-belcher / electrum-personal-server

Maximally lightweight electrum server for a single user
MIT License
599 stars 109 forks source link

Error when Sweeping | Implement blockchain.scripthash.listunspent method #105

Open MrPaz opened 5 years ago

MrPaz commented 5 years ago

Tried using Electrum sweep private keys feature, and repeatedly got the following error.

ERROR:2019-04-03 17:36:04,827: *** BUG! Not handling method: blockchain.scripthash.listunspent query={'jsonrpc': '2.0', 'method': 'blockchain.scripthash.listunspent', 'id': 11040, 'params': ['bc0a68156d2f5cea242b8a79d82623afd3f7d157ec4e229bdc8ab3e87db0fb']}
ERROR:2019-04-03 17:39:12,518: IOError: ConnectionAbortedError(10053, 'An established connection was aborted by the software in your host machine', None, 10053, None)

Not sure if you plan to support sweeping, but thought I'd report it.

chris-belcher commented 5 years ago

Thanks for the issue. I didn't test the sweeping private keys and didn't know that Electrum still used this method.

It can be implemented with the scantxoutset RPC call, although that might be a little bit slow.

CherryDT commented 5 years ago

Hi, we (a company I'm working for) are using Electrum to accept payments in a custom way and we are scanning for data using getaddressunspent on a frozen receiving address, which seems to internally use this "listunspent" command that is not handled. We wanted to move from public Electrum servers (which randomly returned errors and such) to a private one, but unfortunately we discovered this issue only after setting up the whole infrastructure (it was not mentioned in the documentation). Is there any chance this command will be added in the near future? Thanks!

chris-belcher commented 5 years ago

@CherryDT Thanks for the message. This is an FOSS project where people independently work on what they're interested in, so I'm afraid there can't be any guarantees on new features.

Maybe setting up an ElectrumX server might be better for your use case right now ?

CherryDT commented 5 years ago

@chris-belcher Hi, sorry I may have missed the right tone here. I just wanted to know whether it makes sense to wait for this to be implemented (since it was already requested previously by someone, so it would have been possible that you are already working on it or something) or whether we should invest in maybe finding out how to implement this ourselves (which would of course take much more effort for us than for you). I didn't want to make demands or anything, I'm sorry.

The issue with ElectrumX is its magnitude and the system requirements; as I understood we will need much bigger infrastructure for that. But we'll see. Thanks for the answer!

chris-belcher commented 5 years ago

That's OK, I didn't mean anything by my tone either :)

I'm not working on this feature right now. I could probably implement the feature for you if I'm able to bill you for my time. Email me at belcher@riseup.net if you're interested.

Regarding ElectrumX, from what I've heard the biggest cost is synchronization time and disk space. I'm pretty sure I heard of someone running one on a raspberry pi by synchronizing it on a more-powerful computer and then copying over the files to the pi.

shesek commented 5 years ago

If the address is already imported and scanned, couldn't this be delegated to the listunspent rpc command with the third argument set to the address?

Edit: Oh, but this wouldn't really work well with the "Sweet private key" feature, which is typically used with standalone keys that aren't part of the wallet, and so aren't previously imported/scanned.

CherryDT commented 4 years ago

@shesek This would be totally sufficient for my purposes I believe, would you have any hint at how to add this? For example I'm not sure how to get the data that I need for the response fields.