ブロックチェーン トランザクション合計関数
###################### トランザクション の合計を計算する
### 引数数にアドレスを渡して計算する
def calculate_total_amount(self, blockchain_address):
total_amount = 0.0
### ひとつずつ ブロックを取ってくる
for block in self.chain:
### トランザクションを取ってくる
for transaction in block['transactions']:
### インクリメント処理 受け取る
if blockchain_address == transaction['recipient_blockchain_address']:
### ディクリメント処理 送る
if blockchain_address == transaction['sender_blockchain_address']:
return total_amount