本文整理汇总了Java中com.google.bitcoin.core.Message类的典型用法代码示例。如果您正苦于以下问题:Java Message类的具体用法?Java Message怎么用?Java Message使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Message类属于com.google.bitcoin.core包,在下文中一共展示了Message类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: determineOutputsToOfferNextStage
import com.google.bitcoin.core.Message; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void determineOutputsToOfferNextStage(String tx_hex, ObjectSuccessCallback objectSuccessCallback) {
try {
Log.d("SharedCoin", "SharedCoin determineOutputsToOfferNextStage ");
Transaction tx = new Transaction(this.sharedCoin.params, Hex.decode(tx_hex.getBytes()), 0, null, false, true, Message.UNKNOWN_LENGTH);
List<TransactionOutput> transactionOutputs = tx.getOutputs();
JSONArray outpoints_to_offer_next_stage = new JSONArray();
Log.d("SharedCoin", "SharedCoin determineOutputsToOfferNextStage transactionOutputs.size() " + transactionOutputs.size());
for (int i = 0; i < transactionOutputs.size(); i++) {
TransactionOutput output = transactionOutputs.get(i);
Log.d("SharedCoin", "SharedCoin determineOutputsToOfferNextStage i " + i);
if (isOutputOneWeRequested(output)) {
if (isOutputChange(output)) {
JSONObject dict = new JSONObject();
dict.put("hash", null);
dict.put("index", (long) i);
dict.put("value", output.getValue().toString());
outpoints_to_offer_next_stage.add(dict);
}
}
}
Log.d("SharedCoin", "SharedCoin determineOutputsToOfferNextStage outpoints_to_offer_next_stage.size " + outpoints_to_offer_next_stage.size());
objectSuccessCallback.onSuccess(outpoints_to_offer_next_stage);
} catch (ProtocolException e) {
objectSuccessCallback.onFail(e.getLocalizedMessage());
e.printStackTrace();
}
}
示例2: onPreMessageReceived
import com.google.bitcoin.core.Message; //导入依赖的package包/类
@Override
public Message onPreMessageReceived(Peer peer, Message m) {
if (m instanceof Pong) {
// nothing
} else if (m instanceof InventoryMessage) {
InventoryMessage inv = (InventoryMessage) m;
log.info("[MESSAGE INV] size={}\nitem={}",
inv.getItems().size(),
Joiner.on(",").join(Lists.transform(inv.getItems(), FunInvItemToString)));
} else {
log.info("[MESSAGE] = {}", m);
}
return super.onPreMessageReceived(peer, m);
}
示例3: getData
import com.google.bitcoin.core.Message; //导入依赖的package包/类
@Override
public List<Message> getData(Peer peer, GetDataMessage message) {
return null;
}
示例4: onPreMessageReceived
import com.google.bitcoin.core.Message; //导入依赖的package包/类
@Override
public Message onPreMessageReceived(Peer peer, Message message) {
return null;
}
示例5: onPreMessageReceived
import com.google.bitcoin.core.Message; //导入依赖的package包/类
@Override
public Message onPreMessageReceived(Peer peer, Message m) {
return null;
}
示例6: getData
import com.google.bitcoin.core.Message; //导入依赖的package包/类
@Nullable
@Override
public List<Message> getData(Peer peer, GetDataMessage m) {
return null;
}