added fee amount after mining
This commit is contained in:
@@ -247,6 +247,13 @@ def createBlock(self):
|
|||||||
if transaction_count not in selected_transactions:
|
if transaction_count not in selected_transactions:
|
||||||
utilityHelper.addFile("../data/transaction_pool.dat", transaction)
|
utilityHelper.addFile("../data/transaction_pool.dat", transaction)
|
||||||
transaction_count += 1
|
transaction_count += 1
|
||||||
|
# print fee amount
|
||||||
|
fees = 0
|
||||||
|
for i in selected_transactions:
|
||||||
|
if transactions[i].type != 1:
|
||||||
|
fees += transactions[i].inputs[0][1] - transactions[i].outputs[0][1]
|
||||||
|
fees = round(fees, 2)
|
||||||
|
print(f"After validating you will receive a reward of {fees + 50} coins!")
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user