mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-26 01:56:44 +00:00
always find node for first input when retrieving historical notification txes
This commit is contained in:
parent
7f2c5a5a59
commit
1a20e0381c
1 changed files with 3 additions and 1 deletions
|
@ -288,8 +288,10 @@ public class Wallet extends Persistable implements Comparable<Wallet> {
|
||||||
if(txoEntry.getKey().isSpent()) {
|
if(txoEntry.getKey().isSpent()) {
|
||||||
BlockTransaction blockTransaction = getWalletTransaction(txoEntry.getKey().getSpentBy().getHash());
|
BlockTransaction blockTransaction = getWalletTransaction(txoEntry.getKey().getSpentBy().getHash());
|
||||||
if(blockTransaction != null) {
|
if(blockTransaction != null) {
|
||||||
|
TransactionInput txInput0 = blockTransaction.getTransaction().getInputs().get(0);
|
||||||
for(TransactionOutput txOutput : blockTransaction.getTransaction().getOutputs()) {
|
for(TransactionOutput txOutput : blockTransaction.getTransaction().getOutputs()) {
|
||||||
if(notificationAddress.equals(txOutput.getScript().getToAddress())) {
|
if(notificationAddress.equals(txOutput.getScript().getToAddress())
|
||||||
|
&& txoEntry.getValue().getTransactionOutputs().stream().anyMatch(ref -> ref.getHash().equals(txInput0.getOutpoint().getHash()) && ref.getIndex() == txInput0.getOutpoint().getIndex())) {
|
||||||
try {
|
try {
|
||||||
PaymentCode.getOpReturnData(blockTransaction.getTransaction());
|
PaymentCode.getOpReturnData(blockTransaction.getTransaction());
|
||||||
return Map.of(blockTransaction, txoEntry.getValue());
|
return Map.of(blockTransaction, txoEntry.getValue());
|
||||||
|
|
Loading…
Reference in a new issue