mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-31 10:31:35 +00:00
Fix estimate minning fee on testnet
This commit is contained in:
parent
951b0abac3
commit
1ecd1ec7dc
@ -71,6 +71,8 @@ class LNDNode:
|
|||||||
5: "Insufficient local balance.",
|
5: "Insufficient local balance.",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_testnet = lightningstub.GetInfo(lnrpc.GetInfoRequest()).testnet
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_version(cls):
|
def get_version(cls):
|
||||||
try:
|
try:
|
||||||
@ -92,9 +94,14 @@ class LNDNode:
|
|||||||
def estimate_fee(cls, amount_sats, target_conf=2, min_confs=1):
|
def estimate_fee(cls, amount_sats, target_conf=2, min_confs=1):
|
||||||
"""Returns estimated fee for onchain payouts"""
|
"""Returns estimated fee for onchain payouts"""
|
||||||
|
|
||||||
|
if cls.is_testnet:
|
||||||
|
dummy_address = "tb1qehyqhruxwl2p5pt52k6nxj4v8wwc3f3pg7377x"
|
||||||
|
else:
|
||||||
|
dummy_address = "bc1qgxwaqe4m9mypd7ltww53yv3lyxhcfnhzzvy5j3"
|
||||||
|
|
||||||
# We assume segwit. Use hardcoded address as shortcut so there is no need of user inputs yet.
|
# We assume segwit. Use hardcoded address as shortcut so there is no need of user inputs yet.
|
||||||
request = lnrpc.EstimateFeeRequest(
|
request = lnrpc.EstimateFeeRequest(
|
||||||
AddrToAmount={"bc1qgxwaqe4m9mypd7ltww53yv3lyxhcfnhzzvy5j3": amount_sats},
|
AddrToAmount={dummy_address: amount_sats},
|
||||||
target_conf=target_conf,
|
target_conf=target_conf,
|
||||||
min_confs=min_confs,
|
min_confs=min_confs,
|
||||||
spend_unconfirmed=False,
|
spend_unconfirmed=False,
|
||||||
|
Loading…
Reference in New Issue
Block a user