本文整理了Java中org.bitcoinj.wallet.Wallet.clearTransactions()
方法的一些代码示例,展示了Wallet.clearTransactions()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wallet.clearTransactions()
方法的具体详情如下:
包路径:org.bitcoinj.wallet.Wallet
类名称:Wallet
方法名:clearTransactions
[英]Deletes transactions which appeared above the given block height from the wallet, but does not touch the keys. This is useful if you have some keys and wish to replay the block chain into the wallet in order to pick them up. Triggers auto saving.
[中]从钱包中删除出现在给定区块高度以上的交易,但不触摸按键。如果您有一些钥匙,并且希望将区块链重放到钱包中以拾取它们,则此功能非常有用。触发自动保存。
代码示例来源:origin: HashEngineering/dashj
private static void reset() {
// Delete the transactions and save. In future, reset the chain head pointer.
wallet.clearTransactions(0);
saveWallet(walletFile);
}
代码示例来源:origin: cash.bitcoinj/bitcoinj-core
/**
* Deletes transactions which appeared above the given block height from the wallet, but does not touch the keys.
* This is useful if you have some keys and wish to replay the block chain into the wallet in order to pick them up.
* Triggers auto saving.
*/
public void clearTransactions(int fromHeight) {
lock.lock();
try {
if (fromHeight == 0) {
clearTransactions();
saveLater();
} else {
throw new UnsupportedOperationException();
}
} finally {
lock.unlock();
}
}
代码示例来源:origin: fr.acinq/bitcoinj-core
/**
* Deletes transactions which appeared above the given block height from the wallet, but does not touch the keys.
* This is useful if you have some keys and wish to replay the block chain into the wallet in order to pick them up.
* Triggers auto saving.
*/
public void clearTransactions(int fromHeight) {
lock.lock();
try {
if (fromHeight == 0) {
clearTransactions();
saveLater();
} else {
throw new UnsupportedOperationException();
}
} finally {
lock.unlock();
}
}
代码示例来源:origin: greenaddress/GreenBits
/**
* Deletes transactions which appeared above the given block height from the wallet, but does not touch the keys.
* This is useful if you have some keys and wish to replay the block chain into the wallet in order to pick them up.
* Triggers auto saving.
*/
public void clearTransactions(int fromHeight) {
lock.lock();
try {
if (fromHeight == 0) {
clearTransactions();
saveLater();
} else {
throw new UnsupportedOperationException();
}
} finally {
lock.unlock();
}
}
代码示例来源:origin: HashEngineering/dashj
/**
* Deletes transactions which appeared above the given block height from the wallet, but does not touch the keys.
* This is useful if you have some keys and wish to replay the block chain into the wallet in order to pick them up.
* Triggers auto saving.
*/
public void clearTransactions(int fromHeight) {
lock.lock();
try {
if (fromHeight == 0) {
clearTransactions();
saveLater();
} else {
throw new UnsupportedOperationException();
}
} finally {
lock.unlock();
}
}
代码示例来源:origin: cash.bitcoinj/bitcoinj-core
/**
* Prepares the wallet for a blockchain replay. Removes all transactions (as they would get in the way of the
* replay) and makes the wallet think it has never seen a block. {@link WalletEventListener#onWalletChanged} will
* be fired.
*/
public void reset() {
lock.lock();
try {
clearTransactions();
lastBlockSeenHash = null;
lastBlockSeenHeight = -1; // Magic value for 'never'.
lastBlockSeenTimeSecs = 0;
saveLater();
maybeQueueOnWalletChanged();
} finally {
lock.unlock();
}
}
代码示例来源:origin: fr.acinq/bitcoinj-core
/**
* Prepares the wallet for a blockchain replay. Removes all transactions (as they would get in the way of the
* replay) and makes the wallet think it has never seen a block. {@link WalletEventListener#onWalletChanged} will
* be fired.
*/
public void reset() {
lock.lock();
try {
clearTransactions();
lastBlockSeenHash = null;
lastBlockSeenHeight = -1; // Magic value for 'never'.
lastBlockSeenTimeSecs = 0;
saveLater();
maybeQueueOnWalletChanged();
} finally {
lock.unlock();
}
}
代码示例来源:origin: HashEngineering/dashj
/**
* Prepares the wallet for a blockchain replay. Removes all transactions (as they would get in the way of the
* replay) and makes the wallet think it has never seen a block. {@link WalletEventListener#onWalletChanged} will
* be fired.
*/
public void reset() {
lock.lock();
try {
clearTransactions();
lastBlockSeenHash = null;
lastBlockSeenHeight = -1; // Magic value for 'never'.
lastBlockSeenTimeSecs = 0;
saveLater();
maybeQueueOnWalletChanged();
} finally {
lock.unlock();
}
}
代码示例来源:origin: greenaddress/GreenBits
/**
* Prepares the wallet for a blockchain replay. Removes all transactions (as they would get in the way of the
* replay) and makes the wallet think it has never seen a block. {@link WalletEventListener#onWalletChanged} will
* be fired.
*/
public void reset() {
lock.lock();
try {
clearTransactions();
lastBlockSeenHash = null;
lastBlockSeenHeight = -1; // Magic value for 'never'.
lastBlockSeenTimeSecs = 0;
saveLater();
maybeQueueOnWalletChanged();
} finally {
lock.unlock();
}
}
代码示例来源:origin: HashEngineering/dashj
wallet.clearTransactions(0);
File chainFile = new File("restore-from-seed.spvchain");
if (chainFile.exists()) {
内容来源于网络,如有侵权,请联系作者删除!