Skip to content

Commit

Permalink
Make new darkwallets use new format.
Browse files Browse the repository at this point in the history
  • Loading branch information
caedesvvv committed Feb 11, 2016
1 parent ab66a9d commit 93cda01
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/backend/services/stealth.js
Expand Up @@ -163,7 +163,7 @@ define(['backend/port'], function(Port) {
if (height > fromHeight) {
console.log("[stealth] Requesting from block " + fromHeight + " for " + height);
lastStealthRequested = height;
client.fetch_stealth([0,0], onStealthReceived, fromHeight);
client.fetch_stealth2([0,0], onStealthReceived, fromHeight);
// register the id so we can check later its not cancelled
fetchJobId = stealthJobIndex;
stealthJobs[stealthJobIndex] = {type: 'request'};
Expand Down
12 changes: 12 additions & 0 deletions src/vendors/darkwallet_gateway/client/gateway.js
Expand Up @@ -103,6 +103,18 @@ GatewayClient.prototype.fetch_stealth = function(
});
};

GatewayClient.prototype.fetch_stealth2 = function(
prefix, handle_fetch, from_height)
{
GatewayClient._check_function(handle_fetch);

this.make_request("fetch_stealth2", [prefix, from_height],
function(response) {
handle_fetch(response["error"], response["result"][0]);
});
};


/**
* Subscribe
*
Expand Down

4 comments on commit 93cda01

@jonathancross
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how this has any affect on the wallet format used, fetch_stealth2 is just a copy of fetch_stealth?

@ABISprotocol
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is intended to affect thoroughly, e.g. libbitcoin, python-obelisk, gateway.js, sx / bx? Here I see stealth.js and gateway.js

@caedesvvv
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetch_stealth2 returns a different format (it's a different function on the gateway)

this is because of small changes on the stealth spec... fetch_stealth and fetch_stealth2 are part of a backwards compatibility scheme, so both formats can be queried by old and newer wallets. fetch_stealth will get proxied to older obelisk, fetch_stealth2 is querying the new libbitcoin-server that supports a different stealth scheme (different filtering of data contents).

@jonathancross
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining, now I see the server-side proxy change here. Cheers.

Please sign in to comment.