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


Java Message类代码示例

本文整理汇总了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();
	}			
}
 
开发者ID:10xEngineer,项目名称:My-Wallet-Android,代码行数:36,代码来源:SharedCoin.java

示例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);
}
 
开发者ID:y12studio,项目名称:bkbc-tools,代码行数:15,代码来源:DebugPeerEventListener.java

示例3: getData

import com.google.bitcoin.core.Message; //导入依赖的package包/类
@Override
public List<Message> getData(Peer peer, GetDataMessage message) {
	return null;
}
 
开发者ID:newbiecoin,项目名称:newbiecoinj,代码行数:5,代码来源:NewbiecoinPeerEventListener.java

示例4: onPreMessageReceived

import com.google.bitcoin.core.Message; //导入依赖的package包/类
@Override
public Message onPreMessageReceived(Peer peer, Message message) {
	return null;
}
 
开发者ID:newbiecoin,项目名称:newbiecoinj,代码行数:5,代码来源:NewbiecoinPeerEventListener.java

示例5: onPreMessageReceived

import com.google.bitcoin.core.Message; //导入依赖的package包/类
@Override
public Message onPreMessageReceived(Peer peer, Message m) {
    return null;
}
 
开发者ID:hank,项目名称:armorycompanion,代码行数:5,代码来源:PeerActivity.java

示例6: getData

import com.google.bitcoin.core.Message; //导入依赖的package包/类
@Nullable
@Override
public List<Message> getData(Peer peer, GetDataMessage m) {
    return null;
}
 
开发者ID:hank,项目名称:armorycompanion,代码行数:6,代码来源:PeerActivity.java


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