Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
destream-blockchain
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
destream-blockchain
Commits
a8d20c51
Commit
a8d20c51
authored
Feb 06, 2019
by
Sergei Zubov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify TxMemPool
parent
57183cce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
3 deletions
+40
-3
DeStreamFullNodeBuilderMemoryPoolExtension.cs
....MemoryPool/DeStreamFullNodeBuilderMemoryPoolExtension.cs
+1
-1
DeStreamTxMempool.cs
.../Stratis.Bitcoin.Features.MemoryPool/DeStreamTxMempool.cs
+37
-0
TxMemPool.cs
Sources/Stratis.Bitcoin.Features.MemoryPool/TxMemPool.cs
+2
-2
No files found.
Sources/Stratis.Bitcoin.Features.MemoryPool/DeStreamFullNodeBuilderMemoryPoolExtension.cs
View file @
a8d20c51
...
...
@@ -31,7 +31,7 @@ namespace Stratis.Bitcoin.Features.MemoryPool
.
FeatureServices
(
services
=>
{
services
.
AddSingleton
<
MempoolSchedulerLock
>();
services
.
AddSingleton
<
ITxMempool
,
TxMempool
>();
services
.
AddSingleton
<
ITxMempool
,
DeStream
TxMempool
>();
services
.
AddSingleton
<
BlockPolicyEstimator
>();
services
.
AddSingleton
<
IMempoolValidator
,
DeStreamMempoolValidator
>();
services
.
AddSingleton
<
MempoolOrphans
>();
...
...
Sources/Stratis.Bitcoin.Features.MemoryPool/DeStreamTxMempool.cs
0 → 100644
View file @
a8d20c51
using
System.Linq
;
using
Microsoft.Extensions.Logging
;
using
NBitcoin
;
using
Stratis.Bitcoin.Configuration
;
using
Stratis.Bitcoin.Features.MemoryPool.Fee
;
using
Stratis.Bitcoin.Utilities
;
namespace
Stratis.Bitcoin.Features.MemoryPool
{
public
class
DeStreamTxMempool
:
TxMempool
{
public
DeStreamTxMempool
(
IDateTimeProvider
dateTimeProvider
,
BlockPolicyEstimator
blockPolicyEstimator
,
ILoggerFactory
loggerFactory
,
NodeSettings
nodeSettings
)
:
base
(
dateTimeProvider
,
blockPolicyEstimator
,
loggerFactory
,
nodeSettings
)
{
}
/// <inheritdoc />
protected
override
void
RemoveConflicts
(
Transaction
tx
)
{
foreach
(
TxIn
txInput
in
tx
.
Inputs
.
RemoveChangePointer
())
{
NextTxPair
it
=
this
.
MapNextTx
.
FirstOrDefault
(
p
=>
p
.
OutPoint
==
txInput
.
PrevOut
);
if
(
it
==
null
)
continue
;
Transaction
txConflict
=
it
.
Transaction
;
if
(
txConflict
==
tx
)
continue
;
this
.
ClearPrioritisation
(
txConflict
.
GetHash
());
this
.
RemoveRecursive
(
txConflict
);
}
}
}
}
\ No newline at end of file
Sources/Stratis.Bitcoin.Features.MemoryPool/TxMemPool.cs
View file @
a8d20c51
...
...
@@ -854,7 +854,7 @@ namespace Stratis.Bitcoin.Features.MemoryPool
/// Removes conflicting transactions.
/// </summary>
/// <param name="tx">Transaction to remove conflicts from.</param>
pr
ivate
void
RemoveConflicts
(
Transaction
tx
)
pr
otected
virtual
void
RemoveConflicts
(
Transaction
tx
)
{
// Remove transactions which depend on inputs of tx, recursively
//LOCK(cs);
...
...
@@ -877,7 +877,7 @@ namespace Stratis.Bitcoin.Features.MemoryPool
/// Clears the prioritisation for a transaction.
/// </summary>
/// <param name="hash">Transaction hash.</param>
pr
ivate
void
ClearPrioritisation
(
uint256
hash
)
pr
otected
void
ClearPrioritisation
(
uint256
hash
)
{
//LOCK(cs);
this
.
mapDeltas
.
Remove
(
hash
);
...
...
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