cormorant: skip waiting for ibd to complete when networkactive is false

This commit is contained in:
Craig Raw 2025-01-14 14:15:44 +02:00
parent d07a5f0a01
commit bd0aca66b5
3 changed files with 3 additions and 3 deletions

View file

@ -114,7 +114,7 @@ public class BitcoindClient {
tip = blockHeader.getBlockHeader();
timer.schedule(new PollTask(), 5000, 5000);
if(blockchainInfo.initialblockdownload()) {
if(blockchainInfo.initialblockdownload() && networkInfo.networkactive()) {
syncingLock.lock();
try {
syncing = true;

View file

@ -3,6 +3,6 @@ package com.sparrowwallet.sparrow.net.cormorant.bitcoind;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public record NetworkInfo(int version, String subversion) {
public record NetworkInfo(int version, String subversion, boolean networkactive) {
}

View file

@ -45,7 +45,7 @@ public class ElectrumServerService {
@JsonRpcMethod("server.banner")
public String getServerBanner() {
return Cormorant.SERVER_NAME + " " + SparrowWallet.APP_VERSION + "\n" + bitcoindClient.getNetworkInfo().subversion();
return Cormorant.SERVER_NAME + " " + SparrowWallet.APP_VERSION + "\n" + bitcoindClient.getNetworkInfo().subversion() + (bitcoindClient.getNetworkInfo().networkactive() ? "" : " (disconnected)");
}
@JsonRpcMethod("blockchain.estimatefee")