Skip to content

Commit

Permalink
Commits for 0.5.18
Browse files Browse the repository at this point in the history
  • Loading branch information
retsamknaps committed Aug 13, 2017
1 parent 803735d commit f32b95d
Show file tree
Hide file tree
Showing 22 changed files with 3,955 additions and 1,332 deletions.
69 changes: 65 additions & 4 deletions aktie_node/defseed.dat

Large diffs are not rendered by default.

4,649 changes: 3,649 additions & 1,000 deletions aktie_node/spamex.dat

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/aktie/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public Node ( String nodedir, Net net, UpdateCallback uc,
userQueue.addProcessor ( new NewPrivateMessageProcessor ( session, index, pusher, spamtool, usrCallback ) );
userQueue.addProcessor ( new NewSubscriptionProcessor ( session, conMan, index, spamtool, usrCallback ) );
userQueue.addProcessor ( new NewSpamExProcessor ( session, index, identManager, usrCallback ) ) ;
userQueue.addProcessor(new NewDeveloperProcessor(index, identManager, usrCallback));
userQueue.addProcessor ( new NewDeveloperProcessor ( index, identManager, usrCallback ) );
userQueue.addProcessor ( new InSpamExProcessor ( session, index, spamtool, null, null ) );
userQueue.addProcessor ( new NewForceSearcher ( index ) );

Expand Down Expand Up @@ -223,10 +223,10 @@ public void newDeveloperIdentity ( String id )
{
identManager.newDeveloperIdentity ( id );
}
public DeveloperIdentity getDeveloper(String id)

public DeveloperIdentity getDeveloper ( String id )
{
return identManager.getDeveloperIdentity(id);
return identManager.getDeveloperIdentity ( id );
}

public void priorityEnqueue ( CObj o )
Expand Down
4 changes: 2 additions & 2 deletions src/aktie/NodeInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public interface NodeInterface
public NodeUpgrader getUpgrader();

public void close();
public DeveloperIdentity getDeveloper(String id);

public DeveloperIdentity getDeveloper ( String id );

}
7 changes: 4 additions & 3 deletions src/aktie/StandardI2PNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,10 @@ public void closeNode()
}

}

public DeveloperIdentity getDeveloper(String id) {
return node.getDeveloper(id);

public DeveloperIdentity getDeveloper ( String id )
{
return node.getDeveloper ( id );
}

private void preStartUpdate()
Expand Down
16 changes: 9 additions & 7 deletions src/aktie/Wrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class Wrapper
//the upgrade file added to the network by the developer account.
//This keeps new installs from downloading the same version as
//an upgrade
public static long RELEASETIME = ( 1502555389L * 1000L ) + 3600000L;
public static long RELEASETIME = ( 1502594695L * 1000L ) + 3600000L;

//Hash cash payment values
//Process for updating payment: Only increase payment value.
Expand Down Expand Up @@ -266,6 +266,7 @@ public static int Main ( String args[] )
System.out.println ( "Upgrade list: " + uplst.length );

File upgradefile = null;

for ( int c = 0; c < uplst.length; c++ )
{
File uf = uplst[c];
Expand All @@ -279,17 +280,18 @@ public static int Main ( String args[] )

if ( len != null && len.equals ( rlen ) )
{
if (upgradefile == null || upgradefile.lastModified() > uf.lastModified() ) {
upgradefile = uf;
}
if ( upgradefile == null || upgradefile.lastModified() > uf.lastModified() )
{
upgradefile = uf;
}

}

}
if (upgradefile != null)

if ( upgradefile != null )
{
System.out.println("Upgrading from file: " + upgradefile);
System.out.println ( "Upgrading from file: " + upgradefile );
unZipUpgrade ( upgradefile );
saveUpdateLength ( upgradefile.getName(), "-1" );

Expand Down
30 changes: 18 additions & 12 deletions src/aktie/gui/SWTApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,13 @@ private void updateBanner ( CObj co )
{
String creator = co.getString ( CObj.CREATOR );

DeveloperIdentity di = null;
if (creator != null) {
di = node.getDeveloper(creator);
DeveloperIdentity di = null;

if ( creator != null )
{
di = node.getDeveloper ( creator );
}

if ( di != null )
{

Expand Down Expand Up @@ -703,8 +705,8 @@ public void widgetSelected ( SelectionEvent evt )
if ( f.isFile() )
{

DeveloperIdentity di = node.getDeveloper(selectedIdentity.getId());
DeveloperIdentity di = node.getDeveloper ( selectedIdentity.getId() );

CObj nf = new CObj();
nf.setType ( CObj.HASFILE );
nf.pushString ( CObj.COMMUNITYID, selectedCommunity.getDig() );
Expand All @@ -713,12 +715,14 @@ public void widgetSelected ( SelectionEvent evt )

if ( di != null )
{
if (MessageDialog.openConfirm ( shell, "Update", "Are you sure you want this to be an update file?" )) {
nf.pushString ( CObj.UPGRADEFLAG, "true" );
//Set private value too so that we say we have it for ourself.
nf.pushPrivate ( CObj.UPGRADEFLAG, "true" );
node.getNode().enqueue ( nf );
}
if ( MessageDialog.openConfirm ( shell, "Update", "Are you sure you want this to be an update file?" ) )
{
nf.pushString ( CObj.UPGRADEFLAG, "true" );
//Set private value too so that we say we have it for ourself.
nf.pushPrivate ( CObj.UPGRADEFLAG, "true" );
node.getNode().enqueue ( nf );
}

}

else
Expand Down Expand Up @@ -1242,6 +1246,8 @@ private void startedSuccessfully()
//tvc1.setLabelProvider ( new DelegatingStyledCellLabelProvider (
// new IdentitySubTreeLabelProvider() ) );

identTreeViewer.refresh();

pmTab.init();

node.nodeStarted();
Expand Down
5 changes: 3 additions & 2 deletions src/aktie/index/Index.java
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,9 @@ public CObj getLastCreated ( String type, String creator )

return r;
}

public CObjList getAllSpamEx ( String creator ) {

public CObjList getAllSpamEx ( String creator )
{
BooleanQuery.Builder builder = new BooleanQuery.Builder();
//BooleanQuery bq = new BooleanQuery();
Term typterm = new Term ( CObj.PARAM_TYPE, CObj.SPAMEXCEPTION );
Expand Down
62 changes: 34 additions & 28 deletions src/aktie/net/InDeveloperProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import aktie.user.IdentityManager;
import aktie.utils.DigestValidator;

public class InDeveloperProcessor extends GenericProcessor {
public class InDeveloperProcessor extends GenericProcessor
{

Logger log = Logger.getLogger ( "aktie" );

Expand All @@ -25,7 +26,7 @@ public InDeveloperProcessor ( Index i, SpamTool st, IdentityManager im, Connecti
index = i;
connection = ct;
identManager = im;

if ( connection != null )
{
ConId = connection.getLocalDestination().getIdentity();
Expand All @@ -41,48 +42,53 @@ public boolean process ( CObj b )

if ( CObj.DEVELOPER.equals ( type ) )
{
log.info("NEW DEVELOPER ID: " + b.getString(CObj.IDENTITY) + " dig: " + b.getDig());
log.info ( "NEW DEVELOPER ID: " + b.getString ( CObj.IDENTITY ) + " dig: " + b.getDig() );

if ( validator.valid ( b ) )
{
boolean isnew = ( null == index.getByDig ( b.getDig() ) );

//Update creator's ident index
String creator = b.getString ( CObj.CREATOR );
String devid = b.getString(CObj.IDENTITY);
String devid = b.getString ( CObj.IDENTITY );

log.info ( "NEW DEVELOPER ID valid: " + b.getString ( CObj.IDENTITY ) + " dig: " + b.getDig() +
" creator: " + creator + " devid: " + devid );

log.info("NEW DEVELOPER ID valid: " + b.getString(CObj.IDENTITY) + " dig: " + b.getDig() +
" creator: " + creator + " devid: " + devid);
if ( creator != null && devid != null )
{

DeveloperIdentity di = identManager.getDeveloperIdentity(creator);
DeveloperIdentity di = identManager.getDeveloperIdentity ( creator );

if ( di != null )
{
try
{
//sseq.getObj() is only set if a prior developer identity was added
if ( isnew )
{
if ( identManager != null && ConId != null )
{
long gseq = identManager.getGlobalSequenceNumber ( ConId.getId(), false );
b.pushPrivateNumber ( CObj.getGlobalSeq ( ConId.getId() ), gseq );
}

log.info ( "NEW DEVELOPER ID INDEX: " + b.getString ( CObj.IDENTITY ) + " dig: " + b.getDig() );

if (di != null) {
try
{
//sseq.getObj() is only set if a prior developer identity was added
if ( isnew )
{
if ( identManager != null && ConId != null )
{
long gseq = identManager.getGlobalSequenceNumber ( ConId.getId(), false );
b.pushPrivateNumber ( CObj.getGlobalSeq ( ConId.getId() ), gseq );
}
index.index ( b );
identManager.newDeveloperIdentity ( devid );
}

log.info("NEW DEVELOPER ID INDEX: " + b.getString(CObj.IDENTITY) + " dig: " + b.getDig());
}

index.index ( b );
identManager.newDeveloperIdentity( devid );
}
catch ( Exception e )
{
e.printStackTrace();

}
}

catch ( Exception e )
{
e.printStackTrace();
}

}
}
}

}
Expand Down
71 changes: 38 additions & 33 deletions src/aktie/net/InSpamExProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,39 +54,44 @@ public boolean process ( CObj b )

if ( creator != null && seqnum != null )
{

DeveloperIdentity di = null;
if (identManager != null) {
di = identManager.getDeveloperIdentity(creator);
}
if (di != null || identManager == null) {

try
{
SpamSequence sseq = new SpamSequence ( session );
sseq.setId ( creator );
sseq.updateSequence ( b );

//sseq.getObj() is only set if a prior developer identity was added
if ( sseq.getObj() != null && isnew )
{
if ( identManager != null && ConId != null )
{
long gseq = identManager.getGlobalSequenceNumber ( ConId.getId(), false );
b.pushPrivateNumber ( CObj.getGlobalSeq ( ConId.getId() ), gseq );
}

index.index ( b );
}

}

catch ( Exception e )
{
e.printStackTrace();

}
}

DeveloperIdentity di = null;

if ( identManager != null )
{
di = identManager.getDeveloperIdentity ( creator );
}

if ( di != null || identManager == null )
{

try
{
SpamSequence sseq = new SpamSequence ( session );
sseq.setId ( creator );
sseq.updateSequence ( b );

//sseq.getObj() is only set if a prior developer identity was added
if ( sseq.getObj() != null && isnew )
{
if ( identManager != null && ConId != null )
{
long gseq = identManager.getGlobalSequenceNumber ( ConId.getId(), false );
b.pushPrivateNumber ( CObj.getGlobalSeq ( ConId.getId() ), gseq );
}

index.index ( b );
}

}

catch ( Exception e )
{
e.printStackTrace();

}

}

}

Expand Down
4 changes: 2 additions & 2 deletions src/aktie/net/ReqDigProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public boolean process ( CObj b )
CObj.PRIVMESSAGE.equals ( o.getType() ) ||
CObj.COMMUNITY.equals ( o.getType() ) ||
CObj.IDENTITY.equals ( o.getType() ) ||
CObj.SPAMEXCEPTION.equals ( o.getType() ) ||
CObj.DEVELOPER.equals(o.getType()) )
CObj.SPAMEXCEPTION.equals ( o.getType() ) ||
CObj.DEVELOPER.equals ( o.getType() ) )
{
log ( "SND PBLC: " + d );
conThread.enqueue ( o );
Expand Down
2 changes: 1 addition & 1 deletion src/aktie/net/ReqGlobalSeq.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private void filterObjects ( CObjList seqobj, String scomid, String typ, long rn
CObj.COMMUNITY.equals ( o.getType() ) ||
CObj.IDENTITY.equals ( o.getType() ) ||
CObj.SPAMEXCEPTION.equals ( o.getType() ) ||
CObj.DEVELOPER.equals(o.getType()) )
CObj.DEVELOPER.equals ( o.getType() ) )
{
//ANYONE: MEMBERSHIP, PRIVIDENT,
// PRIVMESSAGE, COMMUNITY, IDENTITY, SPAMEXCEPTION, DEVELOPER
Expand Down
2 changes: 1 addition & 1 deletion src/aktie/spam/SpamTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public boolean check ( RSAKeyParameters key, CObj ident, CObj c )

//Check if user is trusted by rank
if ( CObj.SPAMEXCEPTION.equals ( c.getType() ) ||
CObj.DEVELOPER.equals(c.getType()))
CObj.DEVELOPER.equals ( c.getType() ) )
{
checkpayment = false;
}
Expand Down
10 changes: 6 additions & 4 deletions src/aktie/upgrade/NodeUpgrader.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ private void checkDownloadUpgrade ( CObj co )
{
String creator = co.getString ( CObj.CREATOR );

DeveloperIdentity di = null;
if (creator != null) {
di = node.getDeveloper(creator);
DeveloperIdentity di = null;

if ( creator != null )
{
di = node.getDeveloper ( creator );
}

if ( di != null )
{

Expand Down
1 change: 0 additions & 1 deletion src/aktie/upgrade/Upgrade0518.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public static void upgrade ( String nodeDir )

for ( SubTreeEntity e : r )
{
e.setId ( 0 );
gs.merge ( e );
}

Expand Down
Loading

0 comments on commit f32b95d

Please sign in to comment.