Make sure the actual wallet transaction is returned.

There was an issue with the transaction having a non-initialized
updateTime and/or blockTime because the wallet transaction was
not returned.
This commit is contained in:
jmacxx 2022-11-21 09:39:21 -06:00
parent 60522218a7
commit 24ae5f6220
No known key found for this signature in database
GPG key ID: 155297BABFE94A1B

View file

@ -837,17 +837,12 @@ public abstract class WalletService {
Wallet wallet,
TransactionConfidence.Source source) throws VerificationException {
Transaction tx = new Transaction(wallet.getParams(), serializedTransaction);
Transaction walletTransaction = wallet.getTransaction(tx.getTxId());
if (walletTransaction == null) {
if (wallet.getTransaction(tx.getTxId()) == null) {
// We need to recreate the transaction otherwise we get a null pointer...
tx.getConfidence(Context.get()).setSource(source);
//wallet.maybeCommitTx(tx);
wallet.receivePending(tx, null, true);
return tx;
} else {
return walletTransaction;
}
return wallet.getTransaction(tx.getTxId());
}
public static Transaction maybeAddNetworkTxToWallet(byte[] serializedTransaction,