本文整理了Java中org.bitcoinj.wallet.Wallet.addWatchedScripts()
方法的一些代码示例,展示了Wallet.addWatchedScripts()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wallet.addWatchedScripts()
方法的具体详情如下:
包路径:org.bitcoinj.wallet.Wallet
类名称:Wallet
方法名:addWatchedScripts
[英]Adds the given output scripts to the wallet to be watched. Outputs can be retrieved by #getWatchedOutputs(boolean). If a script is already being watched, the object is replaced with the one in the given list. As Scriptequality is defined in terms of program bytes only this lets you update metadata such as creation time. Note that you should be careful not to add scripts with a creation time of zero (the default!) because otherwise it will disable the important wallet checkpointing optimisation.
[中]将给定的输出脚本添加到要观看的钱包中。可以通过#GetWatchedOutput(布尔值)检索输出。如果脚本已被监视,则该对象将替换为给定列表中的对象。由于Scriptequality是根据程序字节定义的,因此仅允许您更新元数据,如创建时间。请注意,您应该小心不要添加创建时间为零(默认值!)的脚本因为否则它将禁用重要的钱包检查点优化。
代码示例来源:origin: HashEngineering/dashj
/**
* Adds the given address to the wallet to be watched. Outputs can be retrieved
* by {@link #getWatchedOutputs(boolean)}.
*
* @return how many addresses were added successfully
*/
public int addWatchedAddresses(final List<Address> addresses, long creationTime) {
List<Script> scripts = Lists.newArrayList();
for (Address address : addresses) {
Script script = ScriptBuilder.createOutputScript(address);
script.setCreationTimeSeconds(creationTime);
scripts.add(script);
}
return addWatchedScripts(scripts);
}
代码示例来源:origin: cash.bitcoinj/bitcoinj-core
/**
* Adds the given address to the wallet to be watched. Outputs can be retrieved
* by {@link #getWatchedOutputs(boolean)}.
*
* @return how many addresses were added successfully
*/
public int addWatchedAddresses(final List<Address> addresses, long creationTime) {
List<Script> scripts = Lists.newArrayList();
for (Address address : addresses) {
Script script = ScriptBuilder.createOutputScript(address);
script.setCreationTimeSeconds(creationTime);
scripts.add(script);
}
return addWatchedScripts(scripts);
}
代码示例来源:origin: fr.acinq/bitcoinj-core
/**
* Adds the given address to the wallet to be watched. Outputs can be retrieved
* by {@link #getWatchedOutputs(boolean)}.
*
* @return how many addresses were added successfully
*/
public int addWatchedAddresses(final List<Address> addresses, long creationTime) {
List<Script> scripts = Lists.newArrayList();
for (Address address : addresses) {
Script script = ScriptBuilder.createOutputScript(address);
script.setCreationTimeSeconds(creationTime);
scripts.add(script);
}
return addWatchedScripts(scripts);
}
代码示例来源:origin: greenaddress/GreenBits
/**
* Adds the given address to the wallet to be watched. Outputs can be retrieved
* by {@link #getWatchedOutputs(boolean)}.
*
* @return how many addresses were added successfully
*/
public int addWatchedAddresses(final List<Address> addresses, long creationTime) {
List<Script> scripts = Lists.newArrayList();
for (Address address : addresses) {
Script script = ScriptBuilder.createOutputScript(address);
script.setCreationTimeSeconds(creationTime);
scripts.add(script);
}
return addWatchedScripts(scripts);
}
代码示例来源:origin: cash.bitcoinj/bitcoinj-core
wallet.addWatchedScripts(ImmutableList.of(contract.getOutput(0).getScriptPubKey()));
stateMachine.transition(State.WAITING_FOR_MULTISIG_ACCEPTANCE);
final SettableFuture<PaymentChannelServerState> future = SettableFuture.create();
代码示例来源:origin: fr.acinq/bitcoinj-core
wallet.addWatchedScripts(ImmutableList.of(contract.getOutput(0).getScriptPubKey()));
stateMachine.transition(State.WAITING_FOR_MULTISIG_ACCEPTANCE);
final SettableFuture<PaymentChannelServerState> future = SettableFuture.create();
代码示例来源:origin: greenaddress/GreenBits
wallet.addWatchedScripts(ImmutableList.of(contract.getOutput(0).getScriptPubKey()));
stateMachine.transition(State.WAITING_FOR_MULTISIG_ACCEPTANCE);
final SettableFuture<PaymentChannelServerState> future = SettableFuture.create();
代码示例来源:origin: HashEngineering/dashj
wallet.addWatchedScripts(ImmutableList.of(contract.getOutput(0).getScriptPubKey()));
stateMachine.transition(State.WAITING_FOR_MULTISIG_ACCEPTANCE);
final SettableFuture<PaymentChannelServerState> future = SettableFuture.create();
代码示例来源:origin: fr.acinq/bitcoinj-core
wallet.addWatchedScripts(scripts);
代码示例来源:origin: HashEngineering/dashj
wallet.addWatchedScripts(scripts);
代码示例来源:origin: cash.bitcoinj/bitcoinj-core
wallet.addWatchedScripts(scripts);
代码示例来源:origin: greenaddress/GreenBits
wallet.addWatchedScripts(scripts);
内容来源于网络,如有侵权,请联系作者删除!