Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: dogisland on November 03, 2011, 05:25:39 PM



Title: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: dogisland on November 03, 2011, 05:25:39 PM
Update: I've added a 20 BTC bounty for the creation of an offline HTML page that creates an address transaction using Javascript.

The Bounty has been claimed.

I want to get a sanity check on something I'm currently working on. At the moment StrongCoin uses BitcoinJS and the BitcoinJS exit node to generate transactions for arbitrary addresses.

The standard bitcoin client already knows what addresses it's looking out for so it doesn't need to go back through the blockchian to collect unspent transaction outs. It just maintains a list of unspent outs as the blocks arrive.

However with StrongCoin you can import a key at any time so I need the ability to get the unspent transaction outs form the past so to speak.

Take this block explorer API call for example http://blockexplorer.com/q/mytransactions/1PurtonoEouSwXZXZqddxWgeLTRJynr51A

Is there enough information in the q/mytransactions call to calculate the unspent outs ?

Has anyone use blockexplorer this way to get at that information ?

If blockexplorer does provide enough information in that call then I reckon it wouldn't be too difficult to knock up a web page (html page) that people could use offline.

i.e.

1. The page would take the BlockExplorer JSON from a q/mytransactions query in a text area. (You could copy it over on a USB).
2. A text area for your private key in hex.
3. A submit button that then uses Javascript to create a Bitcoin transaction (in hex). (BitcoinJS has code for this).
4. This transaction could then be carried over to an online machine and broadcasted.

20 BTC to the first person to implement this. The 20 BTC will be paid through with a transaction created with the page.

So the solution would be 1 html page then a number of JS files (i.e. BitcoinJS etc) that the page links to. This must work with no network connection.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer.
Post by: theymos on November 03, 2011, 06:05:39 PM
I designed /q/mytransactions for things like that. It has all the information you need to do that, assuming your client only sends and receives address transactions. That page doesn't show non-address transactions.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer.
Post by: dogisland on November 03, 2011, 06:28:50 PM
I designed /q/mytransactions for things like that. It has all the information you need to do that, assuming your client only sends and receives address transactions. That page doesn't show non-address transactions.

Thanks. In that case I've added a bounty to see if anyone wants to implement this.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: BTCurious on November 03, 2011, 06:36:03 PM
I will work on this, it seems perfectly doable as far as I can tell.

Edit: One thing the /q/mytransactions doesn't show, is block generation reward. However, I highly doubt that this is relevant for your purposes. It's something to keep in mind, though, if someone ever uses the code to count wallet balance.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: theymos on November 03, 2011, 07:17:40 PM
Something to note: if you're capable of storing data, you can minimize the amount of data you download/process by handling ETag headers and using the block-stop parameter to /q/mytransactions.

It would not be too hard for me to add pubkey-TX support to /q/mytransactions. I haven't seen any demand for it, though.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: BTCurious on November 03, 2011, 07:32:26 PM
Something to note: if you're capable of storing data, you can minimize the amount of data you download/process by handling ETag headers and using the block-stop parameter to /q/mytransactions.
I think processing all transactions of just one address won't be slow enough for the user to get bothered by it, really. I'll code it without storing data first, since that's easier.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: dogisland on November 03, 2011, 07:51:44 PM
It would not be too hard for me to add pubkey-TX support to /q/mytransactions. I haven't seen any demand for it, though.

What is pubkey-TX ?


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: theymos on November 03, 2011, 08:20:28 PM
What is pubkey-TX ?

Transactions can be sent directly to a public key instead of to an address. Some generation transactions do this.

The generations that pools like Eligius produce are actually address transactions, so they will be detected by mytransactions. Nowadays few individuals receive pubkey transactions.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: BTCurious on November 03, 2011, 11:10:11 PM
In what format do you usually have your private key?


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: dogisland on November 04, 2011, 09:14:46 AM
In what format do you usually have your private key?

Base58.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: dogisland on November 07, 2011, 02:28:05 PM
Anyone fancy a go at this ?


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: BTCurious on November 07, 2011, 02:48:23 PM
Is there still one of those broadcast transaction sites, so I can check if everything's working? Can't seem to find it anymore…


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: etotheipi on November 07, 2011, 04:17:55 PM
Is there still one of those broadcast transaction sites, so I can check if everything's working? Can't seem to find it anymore…

It turns out the original site you are thinking of was taken offline, but Nibor is working on one based on this thread (https://bitcointalk.org/index.php?topic=50282).  You could PM him to find out how he's doing on it.

Admittedly, such a site is useful occasionally for folks, but has remarkably low-demand on a regular basis, which is why the original site was taken offline.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: BTCurious on November 08, 2011, 12:23:38 AM
My homemade transaction, and the client's transaction based on that one, were just accepted in the blockchain. Which means it's working :)

(So yes, it took somewhat longer than expected, but everything is in working order now.)

It's available here: http://ge.tt/9XKMag9?c

The library included is bitcoinjs-lib (https://github.com/bitcoinjs/bitcoinjs-lib), so you can download that instead of the lib directory in the zip, then there's less code to "trust".

I haven't done any error catching, so if there is any error (incorrect key, not enough funds, etc), then it will show up in the javascript console.

The user interface is probably self-explanatory, but:
Put in the transaction history (eg this (http://blockexplorer.com/q/mytransactions/18C8ZFaaySGMUqTHdepUMARqUEEg9eiiw9)) in the big box, and the private key for that address in the box below.
Press "Parse"
It will calculate your address (You can verify this is correct), and your current balance.
You can now fill in the target address, the money you want to send, and the fee you want to include. Any change will be sent back to the original address itself.
Press generate to generate the transaction. It will pop up in the bar below the button.

If there are any questions, let me know.

Enjoy, and goodnight :) (Any of the addresses in my sig will do for a payment)

PS: I broadcasted my transaction eventually by hardcoding/hacking it into a python bitcoin client by ThomasV, but since you run strongcoin, you probably have your own broadcast script anyway.

(Screenshot:)
http://img100.imageshack.us/img100/5782/exampleo.png


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: dogisland on November 08, 2011, 09:47:14 AM
This is great. Thanks. 20BTC Payment has been made.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: dogisland on November 08, 2011, 03:11:33 PM
I've written up the process in a blog entry. comments are available here https://bitcointalk.org/index.php?topic=51252.0


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: Jaagu on November 09, 2011, 12:28:53 PM
BTCurious,
I tried your Offline TX generation webpage in 1) IE 6.0 2) OperaTor 3) Google Chrome and 4) FireFox portable.
Parse > Address, Balance worked only in FireFox :-\

Next I tried in Opera.
It returned errors:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

JavaScript - file://localhost/D:/tmp2/offlineTransaction.html
Inline script compilation
Syntax error while loading: line 209 of linked script at file://localhost/D:/tmp2/offlineTransaction.js :
Expected identifier
      for (var b in tx.in ) {
---------------------^
JavaScript - file://localhost/D:/tmp2/offlineTransaction.html
Event thread: click
Error:
name: ReferenceError
message: Statement on line 1: Undefined variable: parseFormData
Backtrace:
  Line 1 of function script
    parseFormData(this.form)
  ...
stacktrace: n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
JavaScript - file://localhost/D:/tmp2/offlineTransaction.html
Event thread: click
Error:
name: ReferenceError
message: Statement on line 1: Undefined variable: parseFormData
Backtrace:
  Line 1 of function script
    parseFormData(this.form)
  ...
stacktrace: n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
JavaScript - file://localhost/D:/tmp2/offlineTransaction.html
Event thread: click
Error:
name: ReferenceError
message: Statement on line 1: Undefined variable: parseFormData
Backtrace:
  Line 1 of function script
    parseFormData(this.form)
  ...
stacktrace: n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
JavaScript - file://localhost/D:/tmp2/offlineTransaction.html
Event thread: click
Error:
name: ReferenceError
message: Statement on line 1: Undefined variable: parseFormData
Backtrace:
  Line 1 of function script
    parseFormData(this.form)
  ...
stacktrace: n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

I am dumbuser. Maybe you could help?


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: BTCurious on November 09, 2011, 01:03:11 PM
BTCurious,
I tried your Offline TX generation webpage in 1) IE 6.0 2) OperaTor 3) Google Chrome and 4) FireFox portable.
Parse > Address, Balance worked only in FireFox :-\

Next I tried in Opera.
It returned errors:
--snip--
Maybe you could help?

Heya!
For me it worked fine in both chrome and firefox. (I just tried on IE, and it didn't work for that. Is there anyone who wants IE to be specifically supported?)

About the Opera error: I suspect the first error is due to the field in the data called "in". "in" is also a javascript keyword, which might cause problems. For me it didn't, so I went with it.
Here's a file with a workaround which shouldn't have that problem: http://ge.tt/9jstkk9

About it not working in various browsers: It might be that it's erroring on some unique thing in the data you gave it. There should be an error console in firefox (Maybe tools > web developer?), or in chrome ("Wrench tool" > tools > javascript console) that will give you an error. Apart from that, can you tell me what address you're trying to parse? I can see if it works for me.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: Jaagu on November 09, 2011, 01:19:43 PM
Your improvement made it work in Chrome (both Address and Balance are returned), but in Opera only Address is returned.
Compatibility with IE would be also desirable, because then one could make tx-s from any computer in the world, without installing bitcoin client and without using online wallets (after nibor gets he's webpage http://bitsend.rowit.co.uk/ (http://bitsend.rowit.co.uk/) fixed (see: https://bitcointalk.org/index.php?topic=50282.msg611729#msg611729 (https://bitcointalk.org/index.php?topic=50282.msg611729#msg611729)).


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: BTCurious on November 09, 2011, 01:31:35 PM
Can you check if you get any errors in a javascript console? It should be somewhere in the menus… I never really use Opera.

Oh btw, "Apart from that, can you tell me what address you're trying to parse? I can see if it works for me." I meant public address (1somethingsomething) of course, not private key.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: Jaagu on November 09, 2011, 01:40:16 PM
Address is:
EDIT: deleted

And Opera Javacript errors are:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

JavaScript - file://localhost/D:/tmp2/offlineTransaction.html
Event thread: click
Error:
name: ReferenceError
message: Statement on line 180: Undefined variable: JSON
Backtrace:
  Line 180 of linked script file://localhost/D:/tmp2/offlineTransaction.js: In function parseTxs
       var tmp = JSON.parse(data);
  Line 140 of linked script file://localhost/D:/tmp2/offlineTransaction.js: In function parseFormData
       var result = parseTxs(form.transactions.value,ownAddress); // {balance:<balance>, unspenttxs:{ "<hash>": { <output index>: { amount:<amount>, script:<script> }}}}
  Line 1 of function script
    parseFormData(this.form)
  ...
stacktrace: n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
JavaScript - file://localhost/D:/tmp2/offlineTransaction.html
Event thread: click
Error:
name: ReferenceError
message: Statement on line 180: Undefined variable: JSON
Backtrace:
  Line 180 of linked script file://localhost/D:/tmp2/offlineTransaction.js: In function parseTxs
       var tmp = JSON.parse(data);
  Line 140 of linked script file://localhost/D:/tmp2/offlineTransaction.js: In function parseFormData
       var result = parseTxs(form.transactions.value,ownAddress); // {balance:<balance>, unspenttxs:{ "<hash>": { <output index>: { amount:<amount>, script:<script> }}}}
  Line 1 of function script
    parseFormData(this.form)
  ...
stacktrace: n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
JavaScript - file://localhost/D:/tmp2/offlineTransaction.html
Event thread: click
Error:
name: ReferenceError
message: Statement on line 180: Undefined variable: JSON
Backtrace:
  Line 180 of linked script file://localhost/D:/tmp2/offlineTransaction.js: In function parseTxs
       var tmp = JSON.parse(data);
  Line 140 of linked script file://localhost/D:/tmp2/offlineTransaction.js: In function parseFormData
       var result = parseTxs(form.transactions.value,ownAddress); // {balance:<balance>, unspenttxs:{ "<hash>": { <output index>: { amount:<amount>, script:<script> }}}}
  Line 1 of function script
    parseFormData(this.form)
  ...
stacktrace: n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: Jaagu on November 09, 2011, 01:44:49 PM
And here is error in OperaTor Javascript console:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

JavaScript - ./offlineTransaction.htm
Inline script compilation
Syntax error while loading: line 209 of linked script at ./offlineTransaction.js :
Expected identifier
      for (var b in tx.in ) {
---------------------^


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: BTCurious on November 09, 2011, 02:20:55 PM
The opera problem is not too hard to fix. Apparently the older operas don't have a native JSON parser, I didn't know that.
Download this new offlineTransaction.html and overwrite the old one: http://ge.tt/9k6qyk9
And put this file in the lib directory: http://ge.tt/88MLyk9

And if you download this offlineTransaction.js and overwrite the old one, the OperaTor problem should be gone too: http://ge.tt/9jstkk9

Internet explorer is a bit harder to fix though… it does some weird things and there's no decent debugger…


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: Jaagu on November 09, 2011, 02:46:19 PM
Thank you for your efforts, but my Opera 9.63 still heralds errors:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

JavaScript - file://localhost/D:/tmp2/offlineTransaction.html
Inline script compilation
Syntax error while loading: line 1 of linked script at file://localhost/D:/tmp2/lib/json2.js :
Expected statement
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-^


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Address is being parsed, balance remains unknown.  :(

----------------

EDIT:
It was my fault. I did not download the right json2.js file (If you'd uploaded *.zip file, there wouldn't been any error).
Now it's working in Opera!  :D



Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: Jaagu on November 11, 2011, 11:29:56 PM
I tried using the offline transaction generator. Two things--  It doesn't seem to work in IE (but does in Firefox), and it doesn't seem to work when you add a transaction fee (but does if you leave it at 0).

BTCurious,
is it really so? Transaction fee > 0 does not work?
Can it be fixed?


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: kano on November 12, 2011, 10:19:56 AM
Um, sorry, gotta ask the obvious question:
Why would anyone want to past their private key anywhere ... ever ...


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: Jaagu on November 12, 2011, 11:15:10 AM
Um, sorry, gotta ask the obvious question:
Why would anyone want to past their private key anywhere ... ever ...

1) Nibor's webpage is downloaded into one's own computer before usage.
2) It's javascript page, therefore computations are made in one's own computer, not on the server side.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: BTCurious on November 12, 2011, 02:16:21 PM
I tried using the offline transaction generator. Two things--  It doesn't seem to work in IE (but does in Firefox), and it doesn't seem to work when you add a transaction fee (but does if you leave it at 0).

BTCurious,
is it really so? Transaction fee > 0 does not work?
Can it be fixed?
Is it really so? Uh, not sure? I haven't noticed it during development, but I'll check it after this weekend (not on my main PC now). If anyone wants to investigate before that, please check what "doesn't seem to work" means. Doesn't show anything? Does give a transaction, but the transaction has no fee? Any different interpretation?

Can it be fixed? Yes, trivially, once I know what exactly is wrong.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: BTCurious on November 14, 2011, 12:40:58 PM
Strange, I tried sending a transaction with a fee via nibor's site, and it didn't get broadcast. Then I sent one via my custom script, and it worked fine. So I figured it was nibor's fault. But now I tried via nibor again, and now it works ???


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: Jaagu on November 14, 2011, 09:52:02 PM
Strange, I tried sending a transaction with a fee via nibor's site, and it didn't get broadcast. Then I sent one via my custom script, and it worked fine. So I figured it was nibor's fault. But now I tried via nibor again, and now it works ???

Could it be, that those transactions take some time? ... But by definition transaction fee should force tx-s getting through almost immediately? Maybe you ask nibor, maybe he changed in the meantime he's code? (I am very much interested that your cooperative pages work!)


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: BTCurious on November 14, 2011, 10:07:54 PM
Could it be, that those transactions take some time?
No, I usually check if I see any unverified transactions on for example bitcoincharts.org (but the original client shows them too), but even after a longer time it didn't work.

Maybe you ask nibor, maybe he changed in the meantime he's code? (I am very much interested that your cooperative pages work!)
Could be, not sure. Maybe btc_novice could try again now? He originally stated that fees didn't work…
What do you mean our cooperative pages?


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: Jaagu on November 15, 2011, 01:37:20 AM
What do you mean our cooperative pages?

I use your page together with nibor's page.
One for creating tx and another for uploading/broadcasting.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: Achim on November 16, 2011, 08:38:48 AM
Hi BTCurious,
Your script to generate offline transactions is a very very helpfull idea, much better than the import of my private key to my wallet e.g with the script pywallet. I've used your script and nibor's broadcasting page many times. At most cases I've got success but some times I've got no success.
May be the following observation can help you for debugging:
At all cases I filled my offline address with a small balance by a single transmission. At all cases I spend no fee for the back transmission by your sript. The success depends on the amount for the back transmission. At all cases I spend the entire balance as amount the transmission succeeded. But all times I spend only a part of the balance and the transmission generates a change I found no broadcasting. May be it is not valid to give back the change to the spend address by a single transmission. Please compare with the discussion on http://bitcoin.stackexchange.com/questions/1629/why-does-bitcoin-send-the-change-to-a-different-address


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: Achim on November 22, 2011, 04:19:31 PM
Today I've succeeded an offline transaction with BTCurious's Tx generation script and nibor's new broadcasting page. My spending amount wars smaller than my balance and so I've got back the change BTC's to the spending address.
May be my observations posted above are only an unfortunate fortuitousness caused by overloading nibor's broadcasting service.
Again I can confirm that the Tx generation script will work excellent.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: dogisland on November 22, 2011, 04:34:13 PM
Today I've succeeded an offline transaction with BTCurious's Tx generation script and nibor's new broadcasting page. My spending amount wars smaller than my balance and so I've got back the change BTC's to the spending address.
May be my observations posted above are only an unfortunate fortuitousness caused by overloading nibor's broadcasting service.
Again I can confirm that the Tx generation script will work excellent.


If you see issues I'm willing to bet you're sending 2 transactions form 1 private key in quick succession.

This won't work as the the logic will pick the same TX out each time. You'll need to wait for each transaction to be picked up in a block then retrieve the TX outs agian from blockexplorer.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: Achim on November 23, 2011, 07:16:28 AM
@dogisland. Thank you for your advise. I understand this problem with quick succession. But no, at my unsuccessful broadcastings I've really observed that there wars no transactions broadcasted. For my tests I've send the BTC's from my offline wallet to my own wallet address handled by the running standard bitcoin client. If broadcasting is done I can see with a small delay for the network distribution the transactions with zero confirmations also before the transaction is bound into the block chain.
But anyway I'm sure the Tx creation is correct and I will use now offline wallets with higher balances to store my Coins.
The only risk for me is the private service from nibor. I can't estimate that he is willing to hold this service available for all time due to the hosting costs and due to the small donations therefore.
May be a more official bitcoin page will double this service.


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: xDan on April 04, 2013, 11:58:03 AM
Hello, can anyone help me with a problem? I'm getting this error when trying to use this:

Cannot read property "amount" of undefined

offlineTransaction.js line 220

Code:
			// if this came from a transaction to our address...
if (lilendHash in unspenttxs) {
unspenttx = unspenttxs[lilendHash];

// remove from unspent transactions, and deduce the amount from the balance
balance = balance.subtract(unspenttx[p.n].amount); <-- line 220
delete unspenttx[p.n]
if (isEmpty(unspenttx)) {
delete unspenttxs[lilendHash]
}
}

So unspenttx[p.n] is undefined for some reason.

The correct address is deduced from the private key but the balance remains zero and I get this error.

This worked fine the first time I used it, just now it doesn't seem to... Something in the changed output from blockexplorer is causing it to fail...


Title: Re: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC)
Post by: Financisto on May 29, 2013, 04:39:30 AM
Any chance in creating something similiar for Litecoin - LTC?  ;)