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


Java BCSAPIException类代码示例

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


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

示例1: scanTransactionsForAddresses

import com.bitsofproof.supernode.api.BCSAPIException; //导入依赖的package包/类
@Override
public void scanTransactionsForAddresses (Set<Address> addresses, long after, TransactionListener listener) throws BCSAPIException
{
	List<byte[]> al = new ArrayList<> (addresses.size ());
	for ( Address a : addresses )
	{
		try
		{
			al.add (a.getAddressScript ());
		}
		catch ( ValidationException e )
		{
		}
	}
	scanRequest (al, after, listener, "matchRequest");
}
 
开发者ID:bitsofproof,项目名称:bop-bitcoin-client,代码行数:17,代码来源:BCSAPIClient.java

示例2: scanUTXOForAddresses

import com.bitsofproof.supernode.api.BCSAPIException; //导入依赖的package包/类
@Override
public void scanUTXOForAddresses (Set<Address> addresses, TransactionListener listener) throws BCSAPIException
{
	List<byte[]> al = new ArrayList<> (addresses.size ());
	for ( Address a : addresses )
	{
		try
		{
			al.add (a.getAddressScript ());
		}
		catch ( ValidationException e )
		{
		}
	}
	scanRequest (al, 0, listener, "utxoMatchRequest");
}
 
开发者ID:bitsofproof,项目名称:bop-bitcoin-client,代码行数:17,代码来源:BCSAPIClient.java

示例3: updateTransaction

import com.bitsofproof.supernode.api.BCSAPIException; //导入依赖的package包/类
@Path ("/{txId}")
@PUT
public Response updateTransaction (@PathParam ("txId") UUID id, PendingTransaction transaction)
{
	if ( !id.equals (transaction.getId ()) )
	{
		return Response.notModified ().build ();
	}
	try
	{
		vault.updateTransaction (api, transaction);
	}
	catch ( BCSAPIException | ValidationException e )
	{
		return Response.serverError ().build ();
	}

	return Response.ok ().build ();
}
 
开发者ID:bitsofproof,项目名称:btc1k,代码行数:20,代码来源:TransactionsResource.java

示例4: Vault

import com.bitsofproof.supernode.api.BCSAPIException; //导入依赖的package包/类
public Vault (Map<String, String> keys) throws BCSAPIException, ValidationException
{
	for ( Map.Entry<String, String> keyEntry : keys.entrySet () )
	{
		publicKeys.put (keyEntry.getKey (), new ECPublicKey (ByteUtils.fromHexString (keyEntry.getValue ()), true));
	}
	log.info ("Vault address: " + getVaultAddress ());
	this.accountManager = new AM ();
	accountManager.setCreated (new DateTime (2013, 12, 1, 0, 0).getMillis ());
	accountManager.addAccountListener (new AccountListener ()
	{
		@Override
		public void accountChanged (AccountManager account, Transaction t)
		{
			log.info ("New account balance " + fromSatoshi (account.getBalance ()) + " " +
					fromSatoshi (account.getConfirmed ()) + " confrirmed " +
					fromSatoshi (account.getChange ()) + " change " +
					fromSatoshi (account.getReceiving ()) + " receiving");
		}
	});
}
 
开发者ID:bitsofproof,项目名称:btc1k,代码行数:22,代码来源:Vault.java

示例5: updateTransaction

import com.bitsofproof.supernode.api.BCSAPIException; //导入依赖的package包/类
public void updateTransaction (BCSAPI api, PendingTransaction transaction) throws BCSAPIException, ValidationException
{
	transaction.setSignedBy (getSignedBy (transaction.getTransaction ()));
	if ( transaction.getSignedBy ().size () > 0 )
	{
		pendingTransactions.put (transaction.getId (), transaction);
		try
		{
			transaction.getTransaction ().computeHash ();
			log.info ("Updated " + transaction.getId () + " to " + transaction.getTransaction ().getHash ());
			if ( getSignedBy (transaction.getTransaction ()).size () >= 2 )
			{
				api.sendTransaction (transaction.getTransaction ());
				log.info ("Successfully sent " + transaction.getTransaction ().getHash ());
				log.info ("transaction: " + transaction.getTransaction ().toWireDump ());
				pendingTransactions.remove (transaction.getId ());
			}
		}
		catch ( BCSAPIException e )
		{
			log.info ("Transaction rejected " + transaction.getTransaction ().getHash ());
			throw e;
		}
	}
}
 
开发者ID:bitsofproof,项目名称:btc1k,代码行数:26,代码来源:Vault.java

示例6: isProduction

import com.bitsofproof.supernode.api.BCSAPIException; //导入依赖的package包/类
@Override
public boolean isProduction () throws BCSAPIException
{
	if ( production != null )
	{
		return production;
	}
	return production = getBlockHeader ("000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f") != null;
}
 
开发者ID:bitsofproof,项目名称:bop-bitcoin-client,代码行数:10,代码来源:BCSAPIClient.java

示例7: processRequest

import com.bitsofproof.supernode.api.BCSAPIException; //导入依赖的package包/类
public void processRequest (String requestId)
{
	try
	{
		BopShopPaymentRequest request = retrieveRequest (requestId);

		processParsedRequest (request);
	}
	catch ( BCSAPIException | ValidationException | IOException e )
	{
		log.error ("Error processing ticket payment", e);
	}
}
 
开发者ID:bitsofproof,项目名称:btc1k,代码行数:14,代码来源:BopShopResource.java

示例8: processCleared

import com.bitsofproof.supernode.api.BCSAPIException; //导入依赖的package包/类
public BopShopResource processCleared () throws JsonParseException, JsonMappingException, ClientProtocolException, UnsupportedEncodingException,
		IOException, ValidationException, BCSAPIException
{
	HttpGet get = new HttpGet ("https://api.bitsofproof.com/mbs/1/paymentRequest?state=CLEARED");
	ObjectMapper mapper = new ObjectMapper ();
	try
	{
		BopShopRequestList list = mapper.readValue (executeGet (get), BopShopRequestList.class);
		if ( list.get_embedded () != null )
		{
			Object item = list.get_embedded ().get ("item");
			if ( item instanceof List )
			{
				for ( Map<String, Object> o : (ArrayList<Map<String, Object>>) item )
				{
					processOneCleared (o);
				}
			}
			else
			{
				processOneCleared ((Map<String, Object>) item);
			}
		}
	}
	catch ( Exception e )
	{
		log.warn ("Can not get cleared requests list", e);
	}
	return this;
}
 
开发者ID:bitsofproof,项目名称:btc1k,代码行数:31,代码来源:BopShopResource.java

示例9: sync

import com.bitsofproof.supernode.api.BCSAPIException; //导入依赖的package包/类
@Override
public void sync (BCSAPI api) throws BCSAPIException
{
	reset ();
	api.scanUTXOForAddresses (getAddresses (), new TransactionListener ()
	{
		@Override
		public boolean process (Transaction t)
		{
			return updateWithTransaction (t);
		}
	});
}
 
开发者ID:bitsofproof,项目名称:btc1k,代码行数:14,代码来源:Vault.java

示例10: syncHistory

import com.bitsofproof.supernode.api.BCSAPIException; //导入依赖的package包/类
@Override
public void syncHistory (BCSAPI api) throws BCSAPIException
{
	reset ();
	api.scanTransactionsForAddresses (getAddresses (), getCreated (), new TransactionListener ()
	{
		@Override
		public boolean process (Transaction t)
		{
			return updateWithTransaction (t);
		}
	});
}
 
开发者ID:bitsofproof,项目名称:btc1k,代码行数:14,代码来源:Vault.java

示例11: run

import com.bitsofproof.supernode.api.BCSAPIException; //导入依赖的package包/类
public void run() {
	String previousHash = chain.getGenesis().getHash();
	for (int blockHeight = 1; blockHeight <= nblocks; ++blockHeight) {
		try {
			Block block = prepareBlockToMine(previousHash, blockHeight);
			mineBlock(block);
			previousHash = block.getHash();
			getApi().sendBlock(block);
		} catch (ValidationException | BCSAPIException e) {
			log.error("Server in a box ", e);
		}
	}
}
 
开发者ID:y12studio,项目名称:BlackBananaCoin,代码行数:14,代码来源:SuperNodeApiTester.java

示例12: scanTransactions

import com.bitsofproof.supernode.api.BCSAPIException; //导入依赖的package包/类
@Override
public void scanTransactions (ExtendedKey master, int firstIndex, int lookAhead, long after, final TransactionListener listener) throws BCSAPIException
{
	scanRequest (master, firstIndex, lookAhead, after, listener, "accountRequest");
}
 
开发者ID:bitsofproof,项目名称:bop-bitcoin-client,代码行数:6,代码来源:BCSAPIClient.java

示例13: createVault

import com.bitsofproof.supernode.api.BCSAPIException; //导入依赖的package包/类
public Vault createVault () throws ValidationException, BCSAPIException
{
	Vault vault = new Vault (keys);
	return vault;
}
 
开发者ID:bitsofproof,项目名称:btc1k,代码行数:6,代码来源:Btc1kConfiguration.java

示例14: start

import com.bitsofproof.supernode.api.BCSAPIException; //导入依赖的package包/类
public void start() throws IOException, ValidationException,
		BCSAPIException, InterruptedException {
	box = new SuperNodeApiTester(new MinerTestChain());
	run();
}
 
开发者ID:y12studio,项目名称:BlackBananaCoin,代码行数:6,代码来源:InABoxTest.java

示例15: main

import com.bitsofproof.supernode.api.BCSAPIException; //导入依赖的package包/类
public static void main(String[] args) throws IOException,
		ValidationException, BCSAPIException, InterruptedException {
	InABoxTest st = new InABoxTest();
	st.start();
}
 
开发者ID:y12studio,项目名称:BlackBananaCoin,代码行数:6,代码来源:InABoxTest.java


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