mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-25 12:57:17 +00:00
Implement something that looks like confirmations, wip
This commit is contained in:
parent
8fe8175c78
commit
d8c675afbf
@ -96,8 +96,10 @@ func (lib *PEthereum) GetTransactionsFor(address string, asJson bool) interface{
|
||||
// Loop through all transactions to see if we missed any while being offline
|
||||
for _, tx := range blk.Transactions() {
|
||||
if bytes.Compare(tx.Sender(), addr) == 0 || bytes.Compare(tx.Recipient, addr) == 0 {
|
||||
ethutil.Config.Log.Debugf("FOund tx: %x\n", tx)
|
||||
txs = append(txs, NewPTx(tx))
|
||||
ptx := NewPTx(tx)
|
||||
//TODO: somehow move this to NewPTx
|
||||
ptx.Confirmations = int(lib.manager.BlockChain().LastBlockNumber - blk.BlockInfo().Number)
|
||||
txs = append(txs, ptx)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,6 +99,7 @@ type PTx struct {
|
||||
Data string `json:"data"`
|
||||
Contract bool `json:"isContract"`
|
||||
CreatesContract bool `json:"createsContract"`
|
||||
Confirmations int `json:"confirmations"`
|
||||
}
|
||||
|
||||
func NewPTx(tx *ethchain.Transaction) *PTx {
|
||||
|
Loading…
Reference in New Issue
Block a user