本文整理了Java中org.bitcoinj.wallet.Wallet.receive()
方法的一些代码示例,展示了Wallet.receive()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wallet.receive()
方法的具体详情如下:
包路径:org.bitcoinj.wallet.Wallet
类名称:Wallet
方法名:receive
[英]Called by the BlockChain when we receive a new block that sends coins to one of our addresses or spends coins from one of our addresses (note that a single transaction can do both).
This is necessary for the internal book-keeping Wallet does. When a transaction is received that sends us coins it is added to a pool so we can use it later to create spends. When a transaction is received that consumes outputs they are marked as spent so they won't be used in future.
A transaction that spends our own coins can be received either because a spend we created was accepted by the network and thus made it into a block, or because our keys are being shared between multiple instances and some other node spent the coins instead. We still have to know about that to avoid accidentally trying to double spend.
A transaction may be received multiple times if is included into blocks in parallel chains. The blockType parameter describes whether the containing block is on the main/best chain or whether it's on a presently inactive side chain. We must still record these transactions and the blocks they appear in because a future block might change which chain is best causing a reorganize. A re-org can totally change our balance!
[中]
代码示例来源:origin: HashEngineering/dashj
if (!isTransactionRelevant(tx))
return;
receive(tx, block, blockType, relativityOffset);
} finally {
lock.unlock();
代码示例来源:origin: cash.bitcoinj/bitcoinj-core
if (!isTransactionRelevant(tx))
return;
receive(tx, block, blockType, relativityOffset);
} finally {
lock.unlock();
代码示例来源:origin: fr.acinq/bitcoinj-core
if (!isTransactionRelevant(tx))
return;
receive(tx, block, blockType, relativityOffset);
} finally {
lock.unlock();
代码示例来源:origin: greenaddress/GreenBits
if (!isTransactionRelevant(tx))
return;
receive(tx, block, blockType, relativityOffset);
} finally {
lock.unlock();
代码示例来源:origin: cash.bitcoinj/bitcoinj-core
receive(tx, block, blockType, relativityOffset);
return true;
} finally {
代码示例来源:origin: fr.acinq/bitcoinj-core
receive(tx, block, blockType, relativityOffset);
return true;
} finally {
代码示例来源:origin: greenaddress/GreenBits
receive(tx, block, blockType, relativityOffset);
return true;
} finally {
代码示例来源:origin: HashEngineering/dashj
receive(tx, block, blockType, relativityOffset);
return true;
} finally {
代码示例来源:origin: cash.bitcoinj/bitcoinj-core
log.info(" tx {}", pair.tx.getHash());
try {
receive(pair.tx, block, BlockChain.NewBlockType.BEST_CHAIN, pair.offset);
} catch (ScriptException e) {
throw new RuntimeException(e); // Cannot happen as these blocks were already verified.
代码示例来源:origin: fr.acinq/bitcoinj-core
log.info(" tx {}", pair.tx.getHash());
try {
receive(pair.tx, block, BlockChain.NewBlockType.BEST_CHAIN, pair.offset);
} catch (ScriptException e) {
throw new RuntimeException(e); // Cannot happen as these blocks were already verified.
代码示例来源:origin: greenaddress/GreenBits
log.info(" tx {}", pair.tx.getHash());
try {
receive(pair.tx, block, BlockChain.NewBlockType.BEST_CHAIN, pair.offset);
} catch (ScriptException e) {
throw new RuntimeException(e); // Cannot happen as these blocks were already verified.
代码示例来源:origin: HashEngineering/dashj
log.info(" tx {}", pair.tx.getHash());
try {
receive(pair.tx, block, BlockChain.NewBlockType.BEST_CHAIN, pair.offset);
} catch (ScriptException e) {
throw new RuntimeException(e); // Cannot happen as these blocks were already verified.
内容来源于网络,如有侵权,请联系作者删除!