Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Commit

Permalink
reset txn height after rebroadcasting txn
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Jan 9, 2018
1 parent b5bc341 commit 657921f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/transactionpool/accept.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,16 @@ func (tp *TransactionPool) AcceptTransactionSet(ts []types.Transaction) error {
// In case of certain errors we still want to broadcast the set
broadcast := err == nil || err == modules.ErrDuplicateTransactionSet
if broadcast {
// This set was broadcasted before if err != nil. We need to update
// it's seen txn height when we rebroadcast it. If we don't do
// that, the transaction will be pruned from the tpool and they
// might no longer show up in the wallet while still beingt
// tracked.
if err != nil {
for _, txn := range ts {
tp.transactionHeights[txn.ID()] = tp.blockHeight
}
}
go tp.gateway.Broadcast("RelayTransactionSet", ts, tp.gateway.Peers())
}
if err != nil {
Expand Down

0 comments on commit 657921f

Please sign in to comment.