LndHub
LndHub copied to clipboard
Fix issue with LndHub & Polar which runs regtest instances
I'm experimenting with LndHub and a regtest bitcoin & lightning network powered by polar.
Regtest addresses it turns out have different prefix than testnet (bcrt), this causes the balance presented by LndHub to be always zero when no bitcoin core node is specified.
This happens because decodeRawTx
takes only mainnet as default parameter.
I'd propose being able to set the network type in the configuration file as well in order to facilitate development on regtest and testnet. This might solve/respond issue #369 as well.
that means I must edit in class User.js from const decodedTx = decodeRawHex(tx.raw_tx_hex); to
const decodedTx = decodeRawHex(tx.raw_tx_hex, config.network); and in config.js add
const bitcoin = require('bitcoinjs-lib')
network: bitcoin.networks.testnet and change .bitcoin to .testnet ?
but I tried it not working it still show 0 balance.
I want to show balance in testnet and use balance in testnet for testing pay invoice form starblock website.
Bear in mind that you should also remove bitcoin core from the config file, as _getChainTransactions
is only called if there's no bitcoind
field in config.
I propose the lightning info need to pass to the class User.js, then get the network type from it and pass to the decodeRawHex.