func (s *EphemeralStore) AddToLimbo(txn types.Transaction) {
	txid := txn.ID()
	if _, ok := s.limbo[txid]; ok {
		return  
	}
	s.limbo[txn.ID()] = LimboTransaction{
		Transaction: txn,
		LimboSince:  time.Now(),
	}
}
AddToLimbo implements Store.
package wallet
import (
	"time"
	"go.sia.tech/siad/modules"
	"go.sia.tech/siad/types"
)
type EphemeralStore struct {
	addrs         map[types.UnlockHash]SeedAddressInfo
	outputs       map[types.SiacoinOutputID]UnspentOutput
	blockrewards  []BlockReward
	filecontracts []FileContract
	txns            map[types.TransactionID]Transaction
	limbo           map[types.TransactionID]LimboTransaction
	txnsAddrIndex   map[types.UnlockHash][]types.TransactionID
	txnsRecentIndex []types.TransactionID
	memos           map[types.TransactionID][]byte
	seedIndex uint64
	height    int
	ccid      modules.ConsensusChangeID
}
func (s *EphemeralStore) ApplyConsensusChange(reverted, applied ProcessedConsensusChange, ccid modules.ConsensusChangeID) {
	for _, o := range reverted.Outputs {
		delete(s.outputs, o.ID)
	}
	for _, br := range reverted.BlockRewards {
		for i := range s.blockrewards {
			if s.blockrewards[i].ID == br.ID {
				s.blockrewards = append(s.blockrewards[:i], s.blockrewards[i+1:]...)
				break
			}
		}
	}
	for _, fc := range reverted.FileContracts {
		for i := range s.filecontracts {
			if s.filecontracts[i].ID == fc.ID && s.filecontracts[i].RevisionNumber == fc.RevisionNumber {
				s.filecontracts = append(s.filecontracts[:i], s.filecontracts[i+1:]...)
				break
			}
		}
	}
	for _, txn := range reverted.Transactions {
		txid := txn.ID()
		delete(s.txns, txid)
		delete(s.limbo, txid)
		for i := range s.txnsRecentIndex {
			if s.txnsRecentIndex[i] == txid {
				s.txnsRecentIndex = append(s.txnsRecentIndex[:i], s.txnsRecentIndex[i+1:]...)
				break
			}
		}
	}
	for addr, txids := range reverted.AddressTransactions {
		addrTxns := s.txnsAddrIndex[addr]
		for _, txid := range txids {
			for i := range addrTxns {
				if addrTxns[i] == txid {
					addrTxns = append(addrTxns[:i], addrTxns[i+1:]...)
					break
				}
			}
		}
		s.txnsAddrIndex[addr] = addrTxns
	}
	for _, o := range applied.Outputs {
		s.outputs[o.ID] = o
	}
	s.blockrewards = append(s.blockrewards, applied.BlockRewards...)
	s.filecontracts = append(s.filecontracts, applied.FileContracts...)
	for _, txn := range applied.Transactions {
		txid := txn.ID()
		s.txns[txid] = txn
		delete(s.limbo, txid)
		s.txnsRecentIndex = append(s.txnsRecentIndex, txid)
	}
	for addr, txids := range applied.AddressTransactions {
		s.txnsAddrIndex[addr] = append(s.txnsAddrIndex[addr], txids...)
	}
	s.height += applied.BlockCount - reverted.BlockCount
	s.ccid = ccid
}
func (s *EphemeralStore) UnspentOutputs() []UnspentOutput {
	outputs := make([]UnspentOutput, 0, len(s.outputs))
	for _, o := range s.outputs {
		outputs = append(outputs, o)
	}
	return outputs
}
func (s *EphemeralStore) Transactions(n int) []types.TransactionID {
	if n > len(s.txnsRecentIndex) || n < 0 {
		n = len(s.txnsRecentIndex)
	}
	return s.txnsRecentIndex[len(s.txnsRecentIndex)-n:]
}
func (s *EphemeralStore) TransactionsByAddress(addr types.UnlockHash, n int) []types.TransactionID {
	txns := s.txnsAddrIndex[addr]
	if n > len(txns) || n < 0 {
		n = len(txns)
	}
	return txns[len(txns)-n:]
}
func (s *EphemeralStore) Transaction(id types.TransactionID) (Transaction, bool) {
	txn, ok := s.txns[id]
	return txn, ok
}