Skip to content

Commit

Permalink
fix displaying txs
Browse files Browse the repository at this point in the history
  • Loading branch information
zack-bitcoin committed Mar 16, 2024
1 parent bd02f44 commit 2bc72ff
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
23 changes: 15 additions & 8 deletions src/js/explorers/tx_explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,24 @@
tx_text.appendChild(br());
tx_text.appendChild(br());
} else if (type === "spend") {
var from = tx[1];
var to = tx[4];
var amount = tx[5];
var link = document.createElement("a");
link.href = "account_explorer.html?pubkey="
.concat(to);
link.innerHTML = to;
link.target = "_blank";
tx_text.innerHTML = "Spend. <br>"
.concat("to: ")
var to_link = make_link("to: ".concat(to), "account_explorer.html?pubkey=".concat(to));
var from_link = make_link("from: ".concat(from), "account_explorer.html?pubkey=".concat(from));

// var link = document.createElement("a");
// link.href = "account_explorer.html?pubkey="
// .concat(to);
// link.innerHTML = to;
// link.target = "_blank";
tx_text.innerHTML = "Spend. <br>";
// .concat("to: ");
//.concat(to)
tx_text.appendChild(link);
tx_text.appendChild(to_link);
tx_text.appendChild(br());
tx_text.appendChild(from_link);
tx_text.appendChild(br());
var span = document.createElement("span");
span.innerHTML = ""
.concat("<br> amount: ")
Expand Down
10 changes: 9 additions & 1 deletion src/js/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,5 +366,13 @@ function newhash2integer(h) {
}
return x;
}
return hash2integer2(h.concat([255]), 0, 0);
// return hash2integer2(h.concat([255]), 0, 0);

function make_link(i, h) {
var link = document.createElement("a");
link.href = h;
link.innerHTML = i;
link.target = "_blank";
return link;
}
}

0 comments on commit 2bc72ff

Please sign in to comment.