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

Commit

Permalink
remove transaction without confirmation older than seven days
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoît HERVIER committed Apr 12, 2013
1 parent cb4107a commit e760829
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions bitpurse/address.py
Expand Up @@ -17,6 +17,7 @@
from utils import prettyPBitcoin
from uuid import uuid4
from datetime import datetime
import time


class Address(object):
Expand Down Expand Up @@ -70,11 +71,16 @@ def __init__(self, jsondict={}):

try:
for tx in jsondict['txs']:
self.transactions.append(TransactionHist(tx['hash'],
tx['timestamp'],
tx['address'],
tx['amount'],
tx['confirmations']))
if (tx['timestamp']
+ (60 * 60 * 24 * 7)
> time.time()) and (tx['confirmations'] >= 1):

self.transactions.append(TransactionHist(
tx['hash'],
tx['timestamp'],
tx['address'],
tx['amount'],
tx['confirmations']))
except KeyError:
pass

Expand Down

0 comments on commit e760829

Please sign in to comment.