当前位置: 首页>>代码示例>>Java>>正文


Java BlockUtil类代码示例

本文整理汇总了Java中net.bither.bitherj.utils.BlockUtil的典型用法代码示例。如果您正苦于以下问题:Java BlockUtil类的具体用法?Java BlockUtil怎么用?Java BlockUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BlockUtil类属于net.bither.bitherj.utils包,在下文中一共展示了BlockUtil类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import net.bither.bitherj.utils.BlockUtil; //导入依赖的package包/类
@Override
public void run() {
    prepare();
    try {
        Block block = BlockUtil.dowloadSpvBlock();
        if (block != null) {
            success(null);
        } else {
            error(0, null);
        }
    } catch (Exception e) {
        error(0, null);
        e.printStackTrace();
    }

}
 
开发者ID:bither,项目名称:bither-desktop-java,代码行数:17,代码来源:DownloadSpvRunnable.java

示例2: startPeerInBackground

import net.bither.bitherj.utils.BlockUtil; //导入依赖的package包/类
private static synchronized void startPeerInBackground() {
    try {

        if (!peerCanRun) {
            return;
        }
        if (!UserPreference.getInstance().getDownloadSpvFinish()) {
            BlockUtil.dowloadSpvBlock();
        }
        if (UserPreference.getInstance().getAppMode() != BitherjSettings.AppMode.COLD) {
            if (!UserPreference.getInstance().getBitherjDoneSyncFromSpv()) {
                if (!PeerManager.instance().isConnected()) {
                    PeerManager.instance().start();
                }
            } else {
                if (!AddressManager.getInstance().addressIsSyncComplete()) {
                    TransactionsUtil.getMyTxFromBither();
                }
                startPeerManager();

            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:bither,项目名称:bither-desktop-java,代码行数:27,代码来源:PeerUtil.java

示例3: run

import net.bither.bitherj.utils.BlockUtil; //导入依赖的package包/类
@Override
public void run() {
    obtainMessage(HandlerMessage.MSG_PREPARE);
    try {
        Block block = BlockUtil.dowloadSpvBlock();
        if (block != null) {
            obtainMessage(HandlerMessage.MSG_SUCCESS);
        } else {
            obtainMessage(HandlerMessage.MSG_FAILURE);
        }
    } catch (Exception e) {
        obtainMessage(HandlerMessage.MSG_FAILURE);
        e.printStackTrace();
    }

}
 
开发者ID:bither,项目名称:bither-android,代码行数:17,代码来源:DownloadSpvRunnable.java

示例4: startPeer

import net.bither.bitherj.utils.BlockUtil; //导入依赖的package包/类
private synchronized void startPeer() {
    try {
        if (peerCanNotRun) {
            return;
        }
        if (UpgradeUtil.needUpgrade()) {
            return;
        }
        if (!AppSharedPreference.getInstance().getDownloadSpvFinish()) {
            Block block = BlockUtil.dowloadSpvBlock();
            if (block == null) {
                return;
            }
        }
        if (AppSharedPreference.getInstance().getAppMode() != BitherjSettings.AppMode.COLD) {
            if (!AppSharedPreference.getInstance().getBitherjDoneSyncFromSpv()) {
                if (!PeerManager.instance().isConnected()) {
                    PeerManager.instance().start();
                    if (!spvFinishedReceivered) {
                        final IntentFilter intentFilter = new IntentFilter();
                        intentFilter.addAction(NotificationAndroidImpl.ACTION_SYNC_FROM_SPV_FINISHED);
                        spvFinishedReceiver = new SPVFinishedReceiver();
                        registerReceiver(spvFinishedReceiver, intentFilter);
                        spvFinishedReceivered = true;
                    }
                }
            } else {
                if (!AddressManager.getInstance().addressIsSyncComplete()) {
                    TransactionsUtil.getMyTxFromBither();
                }
                startPeerManager();

            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

}
 
开发者ID:bither,项目名称:bither-android,代码行数:40,代码来源:BlockchainService.java

示例5: setResult

import net.bither.bitherj.utils.BlockUtil; //导入依赖的package包/类
@Override
public void setResult(String response) throws Exception {
    JSONObject jsonObject = new JSONObject(response);
    JSONArray jsonArray = jsonObject.getJSONArray("blocks");
    JSONObject jsonObject1 = (JSONObject) jsonArray.get(0);
    this.result = BlockUtil.formatStoreBlockFromBlockChainInfo(jsonObject1);
}
 
开发者ID:bither,项目名称:bitherj,代码行数:8,代码来源:BlockChainDownloadSpvApi.java

示例6: setResult

import net.bither.bitherj.utils.BlockUtil; //导入依赖的package包/类
@Override
public void setResult(String response) throws Exception {
    JSONObject jsonObject = new JSONObject(response);
    this.result = BlockUtil.getLatestBlockHeight(jsonObject);
}
 
开发者ID:bither,项目名称:bitherj,代码行数:6,代码来源:BlockChainGetLatestBlockApi.java

示例7: setResult

import net.bither.bitherj.utils.BlockUtil; //导入依赖的package包/类
@Override
public void setResult(String response) throws Exception {
    JSONObject jsonObject = new JSONObject(response);
    this.result = BlockUtil.formatStoredBlock(jsonObject);
}
 
开发者ID:bither,项目名称:bitherj,代码行数:6,代码来源:DownloadSpvApi.java


注:本文中的net.bither.bitherj.utils.BlockUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。