Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions src/org/minima/system/commands/base/coinimport.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,21 @@ public JSONObject runCommand() throws Exception {

//Get the Tree Node..
TxPoWTreeNode node = TxPoWSearcher.getTreeNodeForCoin(newcoin.getCoinID());

//Is it relevant..
if(node.isRelevantEntry(newcoin.getMMREntryNumber())) {
throw new CommandException("Attempting to add relevant coin we already have");
if(node!=null) {

//Is it relevant..
if (node.isRelevantEntry(newcoin.getMMREntryNumber())) {
throw new CommandException("Attempting to add relevant coin we already have");
}

//Add to relevant coins..
node.getRelevantCoinsEntries().add(newcoin.getMMREntryNumber());
node.calculateRelevantCoins();

//Added
ret.put("response", newcoinproof.toJSON());
return ret;
}

//Add to relevant coins..
node.getRelevantCoinsEntries().add(newcoin.getMMREntryNumber());
node.calculateRelevantCoins();

//Added
ret.put("response", newcoinproof.toJSON());
return ret;
}

//Now check that newcoinproof is valid..
Expand Down