Skip to content

Commit

Permalink
Accept broadcaster feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
caedesvvv committed Jan 4, 2015
1 parent 5e2c9db commit 86af84a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/js/backend/services/wallet.js
Expand Up @@ -478,17 +478,17 @@ function(IdentityKeyRing, Port, CurrencyFormatting, TransactionTasks, Bitcoin, B
var hash = newTx.getId();
core.getCurrentIdentity().txdb.setLabel(hash, task.label);
}
var notifyTx = function(error, count) {
var notifyTx = function(error, count, type) {
if (error) {
console.log("Error sending tx: " + error);
console.log("Error sending tx: " + error, count, type);
callback({data: error, text: "Error sending tx"});
} else {
TransactionTasks.processRadar(task, count);

// notify gui about radar updates
Port.post('gui', {type: 'radar', count: count});
Port.post('gui', {type: type, count: count});

callback(null, {radar: count, type: 'radar'});
callback(null, {radar: count, type: type});
console.log("tx radar: " + count);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/js/frontend/controllers/history.js
Expand Up @@ -273,7 +273,7 @@ function (controllers, DarkWallet, Port) {
$scope.rowBroadcast = function(row) {
var done = false;
var client = DarkWallet.getClient();
client.broadcast_transaction(row.tx.toHex(), function(error, count) {
client.broadcast_transaction(row.tx.toHex(), function(error, count, type) {
if (error) {
notify.error("Error broadcasting");
} else if (!done && count) {
Expand Down
2 changes: 2 additions & 0 deletions src/js/frontend/controllers/send.js
Expand Up @@ -235,6 +235,8 @@ function (controllers, Port, DarkWallet, BtcUtils, CurrencyFormat, Bitcoin) {
enableSending();
$tabs.updateTabs($history.pocket.type, $history.pocket.tasks);

} else if (task && task.type == 'brc') {
console.log("broadcaster feedback!", task);
} else if (task && task.type == 'radar') {
if (onUpdateRadar(task.radar || 0, radarCache) && timeoutId) {
enableSending(true);
Expand Down

0 comments on commit 86af84a

Please sign in to comment.