diff options
author | Maran <maran.hidskes@gmail.com> | 2014-06-25 22:23:10 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-06-25 22:23:10 +0800 |
commit | d8c675afbf98178ffa447e4d36b77bbdad3f9ec0 (patch) | |
tree | 9b89ba23dbcb32dad5608d30066645dd3594fc35 /ethpub | |
parent | 8fe8175c7870e18a791888a14630253f5a0476b0 (diff) | |
download | go-tangerine-d8c675afbf98178ffa447e4d36b77bbdad3f9ec0.tar go-tangerine-d8c675afbf98178ffa447e4d36b77bbdad3f9ec0.tar.gz go-tangerine-d8c675afbf98178ffa447e4d36b77bbdad3f9ec0.tar.bz2 go-tangerine-d8c675afbf98178ffa447e4d36b77bbdad3f9ec0.tar.lz go-tangerine-d8c675afbf98178ffa447e4d36b77bbdad3f9ec0.tar.xz go-tangerine-d8c675afbf98178ffa447e4d36b77bbdad3f9ec0.tar.zst go-tangerine-d8c675afbf98178ffa447e4d36b77bbdad3f9ec0.zip |
Implement something that looks like confirmations, wip
Diffstat (limited to 'ethpub')
-rw-r--r-- | ethpub/pub.go | 6 | ||||
-rw-r--r-- | ethpub/types.go | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/ethpub/pub.go b/ethpub/pub.go index c4b10f0e6..05acdb058 100644 --- a/ethpub/pub.go +++ b/ethpub/pub.go @@ -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) } } } diff --git a/ethpub/types.go b/ethpub/types.go index 352598148..0ced68ad1 100644 --- a/ethpub/types.go +++ b/ethpub/types.go @@ -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 { |