<!-- XE-10134 · Pending Send List Duplication: PutPendingSend and CommitUndo omit deduplication on destination index causing phantom duplicate receives · testnet -->
*Markdown view of <https://bounty.xe.network/XE-10134>. The page is the record; this is the same page for reading.*

XE-10134 · Bounty

# Pending Send List Duplication: PutPendingSend and CommitUndo omit deduplication on destination index causing phantom duplicate receives

Closed · duplicate
—
web
filed 2026-11-12 10:10 UTC
by xe:e4cd6974

Verdict
:   Duplicate

Tier
:   —

Claimed
:   —

Area
:   Leasing / ledger

Duplicate of
:   [XE-0135](https://bounty.xe.network/XE-0135) accepted

Tracked
:   internally

Updated
:   2026-11-20 00:33 UTC

Told
:   2026-11-20 00:33 UTC

### Patches

None linked.

### History

- [552592](https://bounty.xe.network/log/552592) 2026-11-20 00:33 UTC proposal.adopted
- [552591](https://bounty.xe.network/log/552591) 2026-11-20 00:33 UTC reply.sent
- [552590](https://bounty.xe.network/log/552590) 2026-11-20 00:33 UTC ticket.status new → closed
- [552010](https://bounty.xe.network/log/552010) 2026-11-20 00:33 UTC proposal.adopted
- [552009](https://bounty.xe.network/log/552009) 2026-11-20 00:33 UTC ticket.facts area
- [552007](https://bounty.xe.network/log/552007) 2026-11-20 00:33 UTC proposal.adopted
- [552006](https://bounty.xe.network/log/552006) 2026-11-20 00:33 UTC ticket.facts
- [552005](https://bounty.xe.network/log/552005) 2026-11-20 00:33 UTC proposal.adopted
- [552004](https://bounty.xe.network/log/552004) 2026-11-20 00:33 UTC ticket.facts
- [552003](https://bounty.xe.network/log/552003) 2026-11-20 00:33 UTC proposal.adopted
- [552002](https://bounty.xe.network/log/552002) 2026-11-20 00:33 UTC ticket.facts
- [550945](https://bounty.xe.network/log/550945) 2026-11-20 00:31 UTC note.added

[Full history](https://bounty.xe.network/log?ref=XE-10134) · [JSON](https://bounty.xe.network/v1/tickets/XE-10134) · [markdown](https://bounty.xe.network/XE-10134.md)

### Report

## Vulnerability Summary

In `store/badger_store.go:224-232` and `1060-1070` (and `store/mem_store.go:120-135`), `PutPendingSend` and `CommitUndo.AddPending` index pending transactions by destination account:

```
		destKey := prefixedKey(prefixPendingDst, ps.Destination)
		var hashes []string
		item, err := txn.Get(destKey)
		if err != nil && err != badger.ErrKeyNotFound {
			return err
		}
		if err == nil {
			if err := item.Value(func(val []byte) error {
				return json.Unmarshal(val, &hashes)
			}); err != nil {
				return err
			}
		}
		hashes = append(hashes, ps.SendHash)
		destData, err := json.Marshal(hashes)
		if err != nil {
			return err
		}
		return txn.Set(destKey, destData)
```

Notice that `hashes = append(hashes, ps.SendHash)` unconditionally appends the send block hash to the destination's pending list slice without deduplication:

1. Idempotency Failure: If `PutPendingSend` is executed more than once for the same send transaction (e.g. during p2p block synchronization re-runs, block re-announcements, or cascade reorg rollbacks), the transaction hash is appended multiple times: `["sendHashA", "sendHashA"]`.
2. Duplicate API \& CLI Responses: `GetPendingByDest` iterates through `hashes` and fetches each item via `GetPendingSend(h)`. It returns a slice containing duplicate `*core.PendingSend` records to API callers (`GET /pending/{address}`).
3. Client Double-Receive Conflict: Automated client tools and CLI (`xe receive`) iterate over `c.GetPending(addr)` and attempt to construct and submit multiple `BlockReceive` blocks referencing the same send hash, causing transaction rejection or self-fork conflicts.

## Proposed Remediation

In `store/badger_store.go` and `store/mem_store.go`, ensure `hashes` is deduplicated before appending:

```
		alreadyPresent := false
		for _, h := range hashes {
			if h == ps.SendHash {
				alreadyPresent = true
				break
			}
		}
		if !alreadyPresent {
			hashes = append(hashes, ps.SendHash)
		}
```

### Thread

**Joseph Denne**team2026-11-20 00:33 UTCdesk

Thanks. This is the same finding as https://bounty.xe.network/XE-0135, which was filed first; the programme pays the
first verifiable submission, so this one closes as a duplicate. If you believe it is a different
bug, file a new report that links https://bounty.xe.network/XE-10134 and says what differs; it is read like any other.
