Skip to content

Commit 6745bea

Browse files
author
Alex Melville
committed
add ability to get network info known by bitcoinjs-lib
Summary: `getNetwork` now takes an argument so the user can specify a network themselves. This is useful in bitgo-cli for the recoverlitecoin function, so we can specify the 'litecoin' network for initializing TransactionBuilder Reviewers: arik, luis, benchan, barath Reviewed By: barath Subscribers: ben Differential Revision: https://phabricator.bitgo.com/D5887
1 parent f21fee1 commit 6745bea

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bitgo",
3-
"version": "3.4.4",
3+
"version": "3.4.5",
44
"description": "BitGo Javascript SDK",
55
"main": "./src/index.js",
66
"keywords": [

src/bitcoin.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ if (isIE) {
2121
secp256k1 = undefined;
2222
}
2323

24-
bitcoin.getNetwork = function() {
25-
return bitcoin.networks[common.getNetwork()];
24+
bitcoin.getNetwork = function(network) {
25+
network = network || common.getNetwork();
26+
return bitcoin.networks[network];
2627
};
2728

2829
bitcoin.makeRandomKey = function() {

0 commit comments

Comments
 (0)