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


Java Script.getToAddress方法代码示例

本文整理汇总了Java中org.bitcoinj.script.Script.getToAddress方法的典型用法代码示例。如果您正苦于以下问题:Java Script.getToAddress方法的具体用法?Java Script.getToAddress怎么用?Java Script.getToAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bitcoinj.script.Script的用法示例。


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

示例1: getWalletAddressOfReceived

import org.bitcoinj.script.Script; //导入方法依赖的package包/类
@Nullable
public static Address getWalletAddressOfReceived(final Transaction tx, final Wallet wallet) {
    for (final TransactionOutput output : tx.getOutputs()) {
        try {
            if (output.isMine(wallet)) {
                final Script script = output.getScriptPubKey();
                return script.getToAddress(Constants.NETWORK_PARAMETERS, true);
            }
        } catch (final ScriptException x) {
            // swallow
        }
    }

    return null;
}
 
开发者ID:ehanoc,项目名称:xwallet,代码行数:16,代码来源:WalletUtils.java

示例2: getOutputAddress

import org.bitcoinj.script.Script; //导入方法依赖的package包/类
static Address getOutputAddress(TransactionOutput out) {
    try {
        Script script = out.getScriptPubKey();
        if (script.isSentToAddress() || script.isPayToScriptHash()) {
            return script.getToAddress(Constants.NETWORK_PARAMS);
        }
    } catch (ScriptException e) {
        // TODO
        //LOG.error("Error while reading transaction output address", e);
    }
    return null;
}
 
开发者ID:eztam-,项目名称:bitcoin-bruteforce,代码行数:13,代码来源:TransactionProcessor.java

示例3: getToAddressOfSent

import org.bitcoinj.script.Script; //导入方法依赖的package包/类
@Nullable
public static Address getToAddressOfSent(final Transaction tx, final Wallet wallet) {
    for (final TransactionOutput output : tx.getOutputs()) {
        try {
            if (!output.isMine(wallet)) {
                final Script script = output.getScriptPubKey();
                return script.getToAddress(Constants.NETWORK_PARAMETERS, true);
            }
        } catch (final ScriptException x) {
            // swallow
        }
    }

    return null;
}
 
开发者ID:ehanoc,项目名称:xwallet,代码行数:16,代码来源:WalletUtils.java

示例4: getAddress

import org.bitcoinj.script.Script; //导入方法依赖的package包/类
public Address getAddress() {
    if (!hasAddress())
        throw new IllegalStateException();

    final Script script = outputs[0].script;
    return script.getToAddress(Constants.NETWORK_PARAMETERS, true);
}
 
开发者ID:guodroid,项目名称:okwallet,代码行数:8,代码来源:PaymentIntent.java

示例5: from

import org.bitcoinj.script.Script; //导入方法依赖的package包/类
public static BitAddress from(CoinType type, Script script) throws AddressMalformedException {
    try {
        return new BitAddress(script.getToAddress(type));
    } catch (WrongNetworkException e) {
        throw new AddressMalformedException(e);
    }
}
 
开发者ID:filipnyquist,项目名称:lbry-android,代码行数:8,代码来源:BitAddress.java

示例6: getMultisig2of2Address

import org.bitcoinj.script.Script; //导入方法依赖的package包/类
private Address getMultisig2of2Address() {
    Script script = createMultisig2of2Script(clientKey, serverKey);
    return script.getToAddress(appConfig.getNetworkParameters());
}
 
开发者ID:coinblesk,项目名称:coinblesk-client-gui,代码行数:5,代码来源:Multisig2of2ToCltvForwardTask.java


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