use of de.schildbach.wallet.data.BlockchainServiceLiveData in project bitcoin-wallet by bitcoin-wallet.
the class AcceptBluetoothService method handleTx.
private boolean handleTx(final Transaction tx) {
log.info("tx {} arrived via blueooth", tx.getTxId());
final Wallet wallet = this.wallet.getValue();
try {
if (wallet.isTransactionRelevant(tx)) {
wallet.receivePending(tx, null);
new BlockchainServiceLiveData(this).observe(this, blockchainService -> blockchainService.broadcastTransaction(tx));
} else {
log.info("tx {} irrelevant", tx.getTxId());
}
return true;
} catch (final VerificationException x) {
log.info("cannot verify tx " + tx.getTxId() + " received via bluetooth", x);
}
return false;
}
Aggregations