Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tangled
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eriksson monteiro
tangled
Commits
26979c85
Commit
26979c85
authored
Jan 27, 2022
by
Eriksson Monteiro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update millix node
parent
1e890bd4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
11 deletions
+53
-11
millix_node/core/config/config.js
millix_node/core/config/config.js
+2
-2
millix_node/core/wallet/wallet.js
millix_node/core/wallet/wallet.js
+35
-8
millix_node/database/repositories/transaction.js
millix_node/database/repositories/transaction.js
+7
-0
millix_node/index.js
millix_node/index.js
+1
-1
millix_node/net/peer.js
millix_node/net/peer.js
+8
-0
No files found.
millix_node/core/config/config.js
View file @
26979c85
...
...
@@ -771,8 +771,8 @@ export const NETWORK_SHORT_TIME_WAIT_MAX = 1500;
export
const
DATABASE_ENGINE
=
'
sqlite
'
;
export
const
DATABASE_CONNECTION
=
{};
export
const
MILLIX_CIRCULATION
=
9
e15
;
export
const
NODE_MILLIX_BUILD_DATE
=
164
2874581
;
export
const
NODE_MILLIX_VERSION
=
'
1.14.
1
-tangled
'
;
export
const
NODE_MILLIX_BUILD_DATE
=
164
0009160
;
export
const
NODE_MILLIX_VERSION
=
'
1.14.
2
-tangled
'
;
export
const
DATA_BASE_DIR_MAIN_NETWORK
=
'
./millix-tangled
'
;
export
const
DATA_BASE_DIR_TEST_NETWORK
=
'
./millix-tangled
'
;
let
DATA_BASE_DIR
=
MODE_TEST_NETWORK
?
DATA_BASE_DIR_TEST_NETWORK
:
DATA_BASE_DIR_MAIN_NETWORK
;
...
...
millix_node/core/wallet/wallet.js
View file @
26979c85
...
...
@@ -896,7 +896,7 @@ class Wallet {
});
})
.
catch
((
err
)
=>
{
console
.
log
(
'
[
Wallet] cleanup dangling transaction
'
,
transaction
.
transaction_id
,
'
. [message]:
'
,
err
);
console
.
log
(
'
[
wallet] cleanup dangling transaction
'
,
transaction
.
transaction_id
,
'
. [message]:
'
,
err
,
'
from node
'
,
ws
.
node
);
delete
this
.
_transactionReceivedFromNetwork
[
transaction
.
transaction_id
];
delete
this
.
_transactionRequested
[
transaction
.
transaction_id
];
walletSync
.
clearTransactionSync
(
transaction
.
transaction_id
);
...
...
@@ -1010,17 +1010,31 @@ class Wallet {
let
ws
=
network
.
getWebSocketByID
(
connectionID
);
if
(
ws
)
{
try
{
const
normalizedTransaction
=
transactionRepository
.
normalizeTransactionObject
(
transaction
);
if
(
normalizedTransaction
)
{
peer
.
transactionSyncResponse
({
transaction
:
transactionRepository
.
normalizeTransactionObject
(
transaction
)
,
transaction
:
normalizedTransaction
,
depth
:
data
.
depth
,
routing
:
data
.
routing
,
routing_request_node_id
:
data
.
routing_request_node_id
},
ws
);
console
.
log
(
`[wallet] sending transaction
${
data
.
transaction_id
}
to node
${
ws
.
nodeID
}
(response time:
${
Date
.
now
()
-
startTimestamp
}
ms)`
);
return
;
}
else
{
console
.
log
(
'
[wallet] it is not possible to normalize the transaction
'
,
data
.
transaction_id
);
}
}
catch
(
e
)
{
console
.
log
(
'
[wallet] error sending transaction sync response. transaction normalization issue.
'
+
e
.
message
);
}
peer
.
transactionSyncResponse
({
transaction
:
{
transaction_id
:
data
.
transaction_id
},
transaction_not_found
:
true
,
depth
:
data
.
depth
,
routing
:
data
.
routing
,
routing_request_node_id
:
data
.
routing_request_node_id
},
ws
);
}
}
else
{
...
...
@@ -1159,6 +1173,11 @@ class Wallet {
_onSyncTransactionSpendTransaction
(
data
,
ws
)
{
if
(
mutex
.
getKeyQueuedSize
([
'
sync-transaction-spend
'
])
>
config
.
NODE_CONNECTION_INBOUND_MAX
)
{
return
peer
.
transactionSpendResponse
(
data
.
transaction_id
,
[],
ws
);
}
let
node
=
ws
.
node
;
let
connectionID
=
ws
.
connectionID
;
const
startTimestamp
=
Date
.
now
();
...
...
@@ -1189,6 +1208,11 @@ class Wallet {
}
_onSyncOutputSpendTransaction
(
data
,
ws
)
{
//TODO: check this
if
(
mutex
.
getKeyQueuedSize
([
'
sync-transaction-spend
'
])
>
config
.
NODE_CONNECTION_INBOUND_MAX
)
{
return
peer
.
transactionOutputSpendResponse
(
data
.
transaction_id
,
data
.
output_position
,
[],
ws
);
}
let
node
=
ws
.
node
;
let
connectionID
=
ws
.
connectionID
;
const
startTimestamp
=
Date
.
now
();
...
...
@@ -1698,6 +1722,9 @@ class Wallet {
}
onPropagateTransactionList
(
data
)
{
if
(
mutex
.
getKeyQueuedSize
([
'
transaction-list-propagate
'
])
>
config
.
NODE_CONNECTION_OUTBOUND_MAX
)
{
return
Promise
.
resolve
();
}
const
{
transaction_id_list
:
transactions
}
=
data
;
if
(
transactions
&&
transactions
.
length
>
0
)
{
mutex
.
lock
([
'
transaction-list-propagate
'
],
unlock
=>
{
...
...
millix_node/database/repositories/transaction.js
View file @
26979c85
...
...
@@ -917,6 +917,13 @@ export default class Transaction {
'
address_attribute
'
,
'
signature
'
])),
'
address_base
'
);
for
(
let
signature
of
transaction
[
'
transaction_signature_list
'
])
{
if
(
!
signature
.
address_attribute
.
key_public
)
{
return
null
;
}
}
transaction
[
'
transaction_date
'
]
=
[
'
0a0
'
,
'
0b0
'
,
...
...
millix_node/index.js
View file @
26979c85
...
...
@@ -126,6 +126,6 @@ db.initialize()
});
}
});
//millix v1.14.
1
-tangled
//millix v1.14.
2
-tangled
\ No newline at end of file
millix_node/net/peer.js
View file @
26979c85
...
...
@@ -146,6 +146,10 @@ class Peer {
}
transactionSend
(
transaction
,
excludeWS
)
{
if
(
!
transaction
)
{
return
;
}
let
payload
=
{
type
:
'
transaction_new
'
,
content
:
{
transaction
}
...
...
@@ -170,6 +174,10 @@ class Peer {
}
transactionSendToNode
(
transaction
,
ws
)
{
if
(
!
transaction
)
{
return
;
}
let
payload
=
{
type
:
'
transaction_new
'
,
content
:
{
transaction
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment