org.bitcoinj.wallet.Wallet.saveLater()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中org.bitcoinj.wallet.Wallet.saveLater()方法的一些代码示例,展示了Wallet.saveLater()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wallet.saveLater()方法的具体详情如下:
包路径:org.bitcoinj.wallet.Wallet
类名称:Wallet
方法名:saveLater

Wallet.saveLater介绍

[英]Requests an asynchronous save on a background thread
[中]在后台线程上请求异步保存

代码示例

代码示例来源: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

/**
 * 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: 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: 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

/**
 * 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

@Override
  public void onConfidenceChanged(TransactionConfidence confidence, TransactionConfidence.Listener.ChangeReason reason) {
    // This will run on the user code thread so we shouldn't do anything too complicated here.
    // We only want to queue a wallet changed event and auto-save if the number of peers announcing
    // the transaction has changed, as that confidence change is made by the networking code which
    // doesn't necessarily know at that point which wallets contain which transactions, so it's up
    // to us to listen for that. Other types of confidence changes (type, etc) are triggered by us,
    // so we'll queue up a wallet change event in other parts of the code.
    if (reason == ChangeReason.SEEN_PEERS) {
      lock.lock();
      try {
        checkBalanceFuturesLocked(null);
        Transaction tx = getTransaction(confidence.getTransactionHash());
        queueOnTransactionConfidenceChanged(tx);
        maybeQueueOnWalletChanged();
      } finally {
        lock.unlock();
      }
    } else if(reason == ChangeReason.IX_TYPE &&
        confidence.getIXType() == TransactionConfidence.IXType.IX_LOCKED) {
      //save the wallet when an InstantSend transaction is locked
      saveLater();
    }
  }
};

代码示例来源:origin: cash.bitcoinj/bitcoinj-core

saveLater();
if (log.isInfoEnabled())
  log.info("Estimated balance is now: {}", getBalance(BalanceType.ESTIMATED).toFriendlyString());

代码示例来源:origin: fr.acinq/bitcoinj-core

saveLater();
if (log.isInfoEnabled())
  log.info("Estimated balance is now: {}", getBalance(BalanceType.ESTIMATED).toFriendlyString());

代码示例来源:origin: greenaddress/GreenBits

saveLater();
if (log.isInfoEnabled())
  log.info("Estimated balance is now: {}", getBalance(BalanceType.ESTIMATED).toFriendlyString());

代码示例来源:origin: HashEngineering/dashj

saveLater();
if (log.isInfoEnabled())
  log.info("Estimated balance is now: {}", getBalance(BalanceType.ESTIMATED).toFriendlyString());

代码示例来源:origin: cash.bitcoinj/bitcoinj-core

isConsistentOrThrow();
saveLater();
hardSaveOnNextBlock = true;

代码示例来源:origin: fr.acinq/bitcoinj-core

isConsistentOrThrow();
saveLater();
hardSaveOnNextBlock = true;

代码示例来源:origin: greenaddress/GreenBits

isConsistentOrThrow();
saveLater();
hardSaveOnNextBlock = true;

代码示例来源:origin: fr.acinq/bitcoinj-core

} else {
  saveLater();

代码示例来源:origin: cash.bitcoinj/bitcoinj-core

} else {
  saveLater();

代码示例来源:origin: greenaddress/GreenBits

} else {
  saveLater();

代码示例来源:origin: HashEngineering/dashj

} else {
  saveLater();

相关文章

微信公众号

最新文章

更多

Wallet类方法