Commit 60424c9c authored by Moul's avatar Moul
Browse files

[mod] tx: create SOURCES_PER_TX constant

in order to play with intermediaries tx
parent 651709cd
......@@ -22,3 +22,4 @@ GTEST_SYMBOL = "ĞTest"
G1_DEFAULT_ENDPOINT = "g1.duniter.org", "443"
G1_TEST_DEFAULT_ENDPOINT = "g1-test.duniter.org", "443"
CONNECTION_TIMEOUT = 10
SOURCES_PER_TX = 40
......@@ -32,7 +32,7 @@ from silkaj.money import (
UDValue,
amount_in_current_base,
)
from silkaj.constants import NO_MATCHING_ID
from silkaj.constants import NO_MATCHING_ID, SOURCES_PER_TX
from duniterpy.api.bma.tx import process
from duniterpy.documents import BlockUID, Transaction
......@@ -193,8 +193,8 @@ async def get_list_input_for_transaction(pubkey, TXamount):
listinputfinal.append(input)
totalAmountInput += amount_in_current_base(input)
TXamount -= amount_in_current_base(input)
# if more 40 sources, it's an intermediate transaction
if len(listinputfinal) >= 40:
# if more than 40 sources, it's an intermediate transaction
if len(listinputfinal) >= SOURCES_PER_TX:
intermediatetransaction = True
break
if TXamount <= 0:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment