[Qt] allow banning and unbanning over UI->peers table #6315

Merged
merged 20 commits into from Sep 22, 2015

Conversation

Projects
None yet
7 participants
@jonasschnelli
Member

jonasschnelli commented Jun 20, 2015

This adds 4 ban options to the peers tables context menu (1h, 24h, 7d, 365d). If there are active bans, a table with banned subnets will be shown.
Sync between the rpc bans and the ui bans are guaranteed over a new uiInterface signal.

Screenshots:
bildschirmfoto-2015-06-20-um-21 58 44
bildschirmfoto-2015-06-20-um-21 58 59

@jonasschnelli

View changes

src/rpcnet.cpp
@@ -527,6 +528,7 @@ UniValue setban(const UniValue& params, bool fHelp)
throw JSONRPCError(RPC_MISC_ERROR, "Error: Unban failed");
}
+ uiInterface.BannedListChanged();

This comment has been minimized.

@jonasschnelli

jonasschnelli Jun 20, 2015

Member

I'm not sure if the locking of a signal emit is done within boost::signal of if this needs explicit locking of uiInterface?

@jonasschnelli

jonasschnelli Jun 20, 2015

Member

I'm not sure if the locking of a signal emit is done within boost::signal of if this needs explicit locking of uiInterface?

This comment has been minimized.

@Diapolo

Diapolo Jun 23, 2015

Perhaps @laanwj can comment on this?

@Diapolo

Diapolo Jun 23, 2015

Perhaps @laanwj can comment on this?

@jonasschnelli

View changes

src/qt/bantablemodel.cpp
+ case Bantime:
+ //show time in users local timezone, not 64bit compatible!
+ //TODO find a way to support 64bit timestamps
+ boost::posix_time::ptime pt1 = boost::posix_time::from_time_t(rec->bantil);

This comment has been minimized.

@jonasschnelli

jonasschnelli Jun 20, 2015

Member

i recognized that boost::posix_time::from_time_t is not 64bit capable. Maybe someone has a idea how to fix this.

@jonasschnelli

jonasschnelli Jun 20, 2015

Member

i recognized that boost::posix_time::from_time_t is not 64bit capable. Maybe someone has a idea how to fix this.

This comment has been minimized.

@Diapolo

Diapolo Jun 20, 2015

What about QDateTime::fromTime_t()?

QDateTime::fromTime_t(rec->bantil).toString() didn't test it...

@Diapolo

Diapolo Jun 20, 2015

What about QDateTime::fromTime_t()?

QDateTime::fromTime_t(rec->bantil).toString() didn't test it...

This comment has been minimized.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

I think this won't work either. The docs are saying: QDateTime QDateTime::fromTime_t(uint seconds) (uint!).

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

I think this won't work either. The docs are saying: QDateTime QDateTime::fromTime_t(uint seconds) (uint!).

This comment has been minimized.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

Found a fix! Pushed.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

Found a fix! Pushed.

@Diapolo

View changes

src/qt/bantablemodel.cpp
+ /** Pull a full list of banned nodes from CNode into our cache */
+ void refreshBanlist()
+ {
+ std::map<CSubNet, int64_t> banMap;

This comment has been minimized.

@Diapolo

Diapolo Jun 20, 2015

I was thinking about a typedef for this, what do you mean?

@Diapolo

Diapolo Jun 20, 2015

I was thinking about a typedef for this, what do you mean?

This comment has been minimized.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

typedefs are useful but can also make reading the code more complicate. In this case (simple map) i don't see a usecase for a typedef.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

typedefs are useful but can also make reading the code more complicate. In this case (simple map) i don't see a usecase for a typedef.

This comment has been minimized.

@aceriou

aceriou Jun 23, 2015

Why would it make it more complicated? Worse comes to worse, you comment it, which is not really needed anyways.

@aceriou

aceriou Jun 23, 2015

Why would it make it more complicated? Worse comes to worse, you comment it, which is not really needed anyways.

@Diapolo

View changes

src/qt/bantablemodel.cpp
+ cachedBanlist.reserve(banMap.size());
+#endif
+ std::map<CSubNet, int64_t>::iterator iter;
+ for (iter = banMap.begin(); iter != banMap.end(); ++iter) {

This comment has been minimized.

@Diapolo

Diapolo Jun 20, 2015

Could this be a Qt foreach? Would also be easy to convert to C++11 then :)?

@Diapolo

Diapolo Jun 20, 2015

Could this be a Qt foreach? Would also be easy to convert to C++11 then :)?

@Diapolo

View changes

src/qt/bantablemodel.cpp
+ }
+ }
+
+ int size()

This comment has been minimized.

@Diapolo

Diapolo Jun 20, 2015

Could this be int size() const?

@Diapolo

Diapolo Jun 20, 2015

Could this be int size() const?

@Diapolo

View changes

src/qt/bantablemodel.cpp
+ {
+ if(idx >= 0 && idx < cachedBanlist.size()) {
+ return &cachedBanlist[idx];
+ } else {

This comment has been minimized.

@Diapolo

Diapolo Jun 20, 2015

That else can be removed. I see you copied most of the code here from peertablemodel.cpp where all these suggestions would also fit and perhaps we should clean it up, to keep the codebase close together?

@Diapolo

Diapolo Jun 20, 2015

That else can be removed. I see you copied most of the code here from peertablemodel.cpp where all these suggestions would also fit and perhaps we should clean it up, to keep the codebase close together?

This comment has been minimized.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

Not sure if this else can be removed. What if the QTableView requests a row at index which is not in the cache QList. Obviously it should not happen because the table size is driven by the size of the cache QList. But I prefer keeping this.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

Not sure if this else can be removed. What if the QTableView requests a row at index which is not in the cache QList. Obviously it should not happen because the table size is driven by the size of the cache QList. But I prefer keeping this.

This comment has been minimized.

@Diapolo

Diapolo Jun 21, 2015

Not sure if you're right here, when the if clause isn't true we always run into the else (as we have a return in the if we won't reach the return 0, if the clause is false). I'd rather remove it...

@Diapolo

Diapolo Jun 21, 2015

Not sure if you're right here, when the if clause isn't true we always run into the else (as we have a return in the if we won't reach the return 0, if the clause is false). I'd rather remove it...

@Diapolo

View changes

src/qt/bantablemodel.cpp
+ }
+ } else if (role == Qt::TextAlignmentRole) {
+ if (index.column() == Bantime)
+ return (int)(Qt::AlignRight | Qt::AlignVCenter);

This comment has been minimized.

@Diapolo

Diapolo Jun 20, 2015

Is int the right type here? I tried (QVariant) which also works.

@Diapolo

Diapolo Jun 20, 2015

Is int the right type here? I tried (QVariant) which also works.

@Diapolo

View changes

src/qt/bantablemodel.cpp
+ {
+ return createIndex(row, column, data);
+ }
+ else

This comment has been minimized.

@Diapolo

Diapolo Jun 20, 2015

Same as above unneeded else. If we don't have data we can return just QModelIndex(). I think it's easier to read without else.

@Diapolo

Diapolo Jun 20, 2015

Same as above unneeded else. If we don't have data we can return just QModelIndex(). I think it's easier to read without else.

@Diapolo

View changes

src/qt/bantablemodel.h
+class QTimer;
+QT_END_NAMESPACE
+
+struct CCombinedBan {

This comment has been minimized.

@Diapolo

Diapolo Jun 20, 2015

We have a struct here and a std::map for similar stuff... is there a way to unify these 2?

@Diapolo

Diapolo Jun 20, 2015

We have a struct here and a std::map for similar stuff... is there a way to unify these 2?

This comment has been minimized.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

I think they should be separated and represent cores and ui form of keeping the data.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

I think they should be separated and represent cores and ui form of keeping the data.

@Diapolo

View changes

src/qt/bantablemodel.cpp
+#include "guiconstants.h"
+#include "guiutil.h"
+
+#include "net.h"

This comment has been minimized.

@Diapolo

Diapolo Jun 20, 2015

This is included in the header already.

@Diapolo

Diapolo Jun 20, 2015

This is included in the header already.

@Diapolo

View changes

src/qt/rpcconsole.cpp
// create context menu actions
- QAction* disconnectAction = new QAction(tr("&Disconnect Node"), this);
+ QAction* disconnectAction = new QAction(tr("&Disconnect Node"), this);
+ QAction* banAction1h = new QAction(tr("&Ban Node for 1 hour"), this);

This comment has been minimized.

@Diapolo

Diapolo Jun 20, 2015

You are repeating some translation text, perhaps there is an efficient way to reduce that?

@Diapolo

Diapolo Jun 20, 2015

You are repeating some translation text, perhaps there is an efficient way to reduce that?

This comment has been minimized.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

split into two strings to reduce translation effort.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

split into two strings to reduce translation effort.

@Diapolo

View changes

src/qt/rpcconsole.cpp
+ SplitHostPort(nStr, port, addr);
+
+ CNode::Ban(CNetAddr(addr), bantime);
+ bannedNode->CloseSocketDisconnect();

This comment has been minimized.

@Diapolo

Diapolo Jun 20, 2015

Seems you reintroduced that over fDisconnect flag?

@Diapolo

Diapolo Jun 20, 2015

Seems you reintroduced that over fDisconnect flag?

This comment has been minimized.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

This was a serious overlook. Fixed. Thanks.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

This was a serious overlook. Fixed. Thanks.

@Diapolo

View changes

src/qt/rpcconsole.cpp
+
+void RPCConsole::showOrHideBanTableIfRequired()
+{
+ bool visible = clientModel->getBanTableModel()->shouldShow();

This comment has been minimized.

@Diapolo

Diapolo Jun 20, 2015

This could also use a NULL pointer check for clientModel IMHO.

@Diapolo

Diapolo Jun 20, 2015

This could also use a NULL pointer check for clientModel IMHO.

This comment has been minimized.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

Nullpointer check added.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

Nullpointer check added.

@Diapolo

This comment has been minimized.

Show comment
Hide comment
@Diapolo

Diapolo Jun 20, 2015

Great pull IMHO, sorry for hitting you hard with that bunch of comments...

Diapolo commented Jun 20, 2015

Great pull IMHO, sorry for hitting you hard with that bunch of comments...

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Jun 21, 2015

Member

Thanks @Diapolo for the review. Appricate detailed feedback.
Will fix all your points (especially the miss transaction to fDisconnect!).

Member

jonasschnelli commented Jun 21, 2015

Thanks @Diapolo for the review. Appricate detailed feedback.
Will fix all your points (especially the miss transaction to fDisconnect!).

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@Diapolo

View changes

src/qt/bantablemodel.cpp
+ }
+ } else if (role == Qt::TextAlignmentRole) {
+ if (index.column() == Bantime)
+ return (int)(Qt::AlignRight | Qt::AlignVCenter);

This comment has been minimized.

@Diapolo

Diapolo Jun 21, 2015

Still the question: Is int the right type here? I tried (QVariant) which also works and is more the Qt style?

@Diapolo

Diapolo Jun 21, 2015

Still the question: Is int the right type here? I tried (QVariant) which also works and is more the Qt style?

This comment has been minimized.

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

Right. This is also the same as we have it in PeersTableModel, it works, but i agree that it should be QVariant (as the method definition says).

@jonasschnelli

jonasschnelli Jun 21, 2015

Member

Right. This is also the same as we have it in PeersTableModel, it works, but i agree that it should be QVariant (as the method definition says).

This comment has been minimized.

@Diapolo

Diapolo Jun 21, 2015

I opened #6317 and will try to keep that in sync with what we are doing here :).

@Diapolo

Diapolo Jun 21, 2015

I opened #6317 and will try to keep that in sync with what we are doing here :).

@Diapolo

View changes

src/qt/clientmodel.cpp
@@ -226,12 +240,19 @@ static void NotifyAlertChanged(ClientModel *clientmodel, const uint256 &hash, Ch
Q_ARG(int, status));
}
+static void BannedListChanged(ClientModel *clientmodel)
+{
+ qDebug() << "BannedListChanged";

This comment has been minimized.

@Diapolo

Diapolo Jun 21, 2015

You could also use something like:
qDebug() << QString("%1: Requesting update for peer banlist").arg(__func__); I intend to creat a pull to make use of that format so we have the debug logging include always the correct function name :).

@Diapolo

Diapolo Jun 21, 2015

You could also use something like:
qDebug() << QString("%1: Requesting update for peer banlist").arg(__func__); I intend to creat a pull to make use of that format so we have the debug logging include always the correct function name :).

@Diapolo

View changes

src/qt/rpcconsole.cpp
@@ -8,6 +8,7 @@
#include "clientmodel.h"
#include "guiutil.h"
#include "peertablemodel.h"
+#include "bantablemodel.h"

This comment has been minimized.

@Diapolo

Diapolo Jun 21, 2015

Not even a nit, but a please: Can you add #include "bantablemodel.h" above clientmodel :)?

@Diapolo

Diapolo Jun 21, 2015

Not even a nit, but a please: Can you add #include "bantablemodel.h" above clientmodel :)?

@Diapolo

View changes

src/qt/rpcconsole.cpp
connect(disconnectAction, SIGNAL(triggered()), this, SLOT(disconnectSelectedNode()));
+ //add a signal mapping to allow a dynamic argument

This comment has been minimized.

@Diapolo

Diapolo Jun 21, 2015

Nit: These comments are missing a whitespace at the front.

@Diapolo

Diapolo Jun 21, 2015

Nit: These comments are missing a whitespace at the front.

@Diapolo

View changes

src/qt/rpcconsole.cpp
@@ -335,6 +380,9 @@ void RPCConsole::setClientModel(ClientModel *model)
ui->startupTime->setText(model->formatClientStartupTime());
ui->networkName->setText(QString::fromStdString(Params().NetworkIDString()));
+
+ connect(model, SIGNAL(banListChanged()), this, SLOT(showOrHideBanTableIfRequired()));

This comment has been minimized.

@Diapolo

Diapolo Jun 21, 2015

I'd rather group these near the banlist stuff or add some small comment, before this is getting confusing here?

@Diapolo

Diapolo Jun 21, 2015

I'd rather group these near the banlist stuff or add some small comment, before this is getting confusing here?

@Diapolo

This comment has been minimized.

Show comment
Hide comment
@Diapolo

Diapolo Jun 21, 2015

Currently integrating this into my build to test, will report back :).

Diapolo commented Jun 21, 2015

Currently integrating this into my build to test, will report back :).

@Diapolo

This comment has been minimized.

Show comment
Hide comment
@Diapolo

Diapolo Jun 21, 2015

Observations:

  1. Banning a node, selecting a new node (from connected peers) and then selecting a banned node leaves the details of the previous (not banned) node visible in the right area.
  2. Banning a node selects the first cell in the banlist table without selecting the whole line and without a focus (cell is not marked active). I'd suggest the banned node should be selected and active entirely.
  3. I'm using Tor and hidden-service addresses + netmask + banned until are that large that I'm unable to view the whole values with the default sizes.
  4. The banned peers list has a heading Banned peers, perhaps the connected peers also should get a heading? I'd vote for a much smaller font size, the current one looks rather too big.

Edit:

  1. There is a serious issue with banning incomming connections via Tor, these are all shown as 127.0.0.1 and handling them seems broken.

Diapolo commented Jun 21, 2015

Observations:

  1. Banning a node, selecting a new node (from connected peers) and then selecting a banned node leaves the details of the previous (not banned) node visible in the right area.
  2. Banning a node selects the first cell in the banlist table without selecting the whole line and without a focus (cell is not marked active). I'd suggest the banned node should be selected and active entirely.
  3. I'm using Tor and hidden-service addresses + netmask + banned until are that large that I'm unable to view the whole values with the default sizes.
  4. The banned peers list has a heading Banned peers, perhaps the connected peers also should get a heading? I'd vote for a much smaller font size, the current one looks rather too big.

Edit:

  1. There is a serious issue with banning incomming connections via Tor, these are all shown as 127.0.0.1 and handling them seems broken.
@Diapolo

This comment has been minimized.

Show comment
Hide comment
@Diapolo

Diapolo Jun 21, 2015

There is also an issue with removing a peer from banned peers list when banned until is over:
ban

The peer should be removed from the list, which is not working currently.

listbanned also still shows them:
[
{
"address": "127.0.0.1/255.255.255.255",
"banned_untill": 1434891295
},
{
"address": "nkf5e6b7pl4jfd4a.onion/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
"banned_untill": 1434891291
},
{
"address": "t6xj6wilh4ytvcs7.onion/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
"banned_untill": 1434891400
}
]

Diapolo commented Jun 21, 2015

There is also an issue with removing a peer from banned peers list when banned until is over:
ban

The peer should be removed from the list, which is not working currently.

listbanned also still shows them:
[
{
"address": "127.0.0.1/255.255.255.255",
"banned_untill": 1434891295
},
{
"address": "nkf5e6b7pl4jfd4a.onion/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
"banned_untill": 1434891291
},
{
"address": "t6xj6wilh4ytvcs7.onion/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
"banned_untill": 1434891400
}
]

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Jun 21, 2015

Member

@Diapolo: for autocleaning then ban list see PR #6310

I think you point 1) is not a problem. The peer is still selected (gray) when you interact with the bantable. Point 2) and 3) are cosmetics and should not hold this PR back. Point 4) agreed.

Banning tor nodes needs testing (best first over RPC) and maybe needs more implementation. Would be good if you could see what's missing there.

Member

jonasschnelli commented Jun 21, 2015

@Diapolo: for autocleaning then ban list see PR #6310

I think you point 1) is not a problem. The peer is still selected (gray) when you interact with the bantable. Point 2) and 3) are cosmetics and should not hold this PR back. Point 4) agreed.

Banning tor nodes needs testing (best first over RPC) and maybe needs more implementation. Would be good if you could see what's missing there.

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Jun 21, 2015

Member

Tested also with Tor nodes. Works fine. @Diapolo: what issues did you encounter with tor nodes?

Member

jonasschnelli commented Jun 21, 2015

Tested also with Tor nodes. Works fine. @Diapolo: what issues did you encounter with tor nodes?

@laanwj laanwj added the GUI label Jun 22, 2015

@Diapolo

This comment has been minimized.

Show comment
Hide comment
@Diapolo

Diapolo Jun 22, 2015

@jonasschnelli The problem are incoming Tor nodes with 127.0.0.1 blocking one connected node blocks any other incoming 127.0.0.1 node. Other connected 127.0.0.1 are not affected.

Also I'd suggest splitting of the autocleaning pull from the disk-store-pull as autocleaning is uncontroversial and also needed by this one.

I also disagree on ignoring UI or UX issues for now as often such "small" or "minor" things are just forgotton or I pick them up. I'd vote for making this pull good and not just "working okay" :).

Diapolo commented Jun 22, 2015

@jonasschnelli The problem are incoming Tor nodes with 127.0.0.1 blocking one connected node blocks any other incoming 127.0.0.1 node. Other connected 127.0.0.1 are not affected.

Also I'd suggest splitting of the autocleaning pull from the disk-store-pull as autocleaning is uncontroversial and also needed by this one.

I also disagree on ignoring UI or UX issues for now as often such "small" or "minor" things are just forgotton or I pick them up. I'd vote for making this pull good and not just "working okay" :).

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Jun 22, 2015

Member

Fixed @Diapolos nits.

Member

jonasschnelli commented Jun 22, 2015

Fixed @Diapolos nits.

@luke-jr

This comment has been minimized.

Show comment
Hide comment
@luke-jr

luke-jr Jun 23, 2015

Member

Can the netmask be changed to the more modern (eg) /24 /128 etc format? Also prefer to have banned peers not take up space in the peer tab... somehow.

Member

luke-jr commented Jun 23, 2015

Can the netmask be changed to the more modern (eg) /24 /128 etc format? Also prefer to have banned peers not take up space in the peer tab... somehow.

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Jun 23, 2015

Member

Updated.
Added a commit that uses CIDR notation (like /32) when printing (ToString()) CSubNet.

UI and RPC looks now like...
bildschirmfoto 2015-06-23 um 17 19 17
bildschirmfoto 2015-06-23 um 17 19 21

Member

jonasschnelli commented Jun 23, 2015

Updated.
Added a commit that uses CIDR notation (like /32) when printing (ToString()) CSubNet.

UI and RPC looks now like...
bildschirmfoto 2015-06-23 um 17 19 17
bildschirmfoto 2015-06-23 um 17 19 21

@Diapolo

This comment has been minimized.

Show comment
Hide comment
@Diapolo

Diapolo Jun 23, 2015

@jonasschnelli Thanks for your hard work on this, still there is a second round of nits open I made and also still the UX problems, the autoupdate (I have comments in the other pull also, so I'm fine if that get's some love or merged soon :)) and 127.0.0.1 handling for incoming Tor.

Diapolo commented Jun 23, 2015

@jonasschnelli Thanks for your hard work on this, still there is a second round of nits open I made and also still the UX problems, the autoupdate (I have comments in the other pull also, so I'm fine if that get's some love or merged soon :)) and 127.0.0.1 handling for incoming Tor.

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Jun 23, 2015

Member

@Diapolo: what nits are open? Font size, selecting rows, column sized are fixed.
Autocleanup is not in this PR and it will stay in #6310 because it makes most sense to clean data before writing to disk. It's not a bug if your ban list keeps a entry which has expired.
Feel free to write a patch/commit for the incoming tor node banning (separate bans by port). I won't cover it in this PR.

Member

jonasschnelli commented Jun 23, 2015

@Diapolo: what nits are open? Font size, selecting rows, column sized are fixed.
Autocleanup is not in this PR and it will stay in #6310 because it makes most sense to clean data before writing to disk. It's not a bug if your ban list keeps a entry which has expired.
Feel free to write a patch/commit for the incoming tor node banning (separate bans by port). I won't cover it in this PR.

@Diapolo

This comment has been minimized.

Show comment
Hide comment
@Diapolo

Diapolo Jun 23, 2015

@jonasschnelli Last time I saw quite some uncommented stuff in the code, even if minor. I need to resync from your repo and take another look then.

Diapolo commented Jun 23, 2015

@jonasschnelli Last time I saw quite some uncommented stuff in the code, even if minor. I need to resync from your repo and take another look then.

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Jun 23, 2015

Member

Added @Diapolos polishing commit on top.

Member

jonasschnelli commented Jun 23, 2015

Added @Diapolos polishing commit on top.

@Diapolo

This comment has been minimized.

Show comment
Hide comment
@Diapolo

Diapolo Jun 23, 2015

Great, if I find the time I'll further investigate the Tor handling and also re-check the UX problems after I #6310 is merged (or after I integrated it into my build).

Diapolo commented Jun 23, 2015

Great, if I find the time I'll further investigate the Tor handling and also re-check the UX problems after I #6310 is merged (or after I integrated it into my build).

@Diapolo

This comment has been minimized.

Show comment
Hide comment
@Diapolo

Diapolo Jun 23, 2015

I've got another pull in the pipe covering UX issues, but I need to digg in deeper...

Diapolo commented Jun 23, 2015

I've got another pull in the pipe covering UX issues, but I need to digg in deeper...

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Jun 25, 2015

Member

@jonasschnelli Fixed the CSubNet::ToString function for subnets that can't be represented as /x, please pick the top commit from https://github.com/laanwj/bitcoin/tree/2015_06_cideriad

Member

laanwj commented Jun 25, 2015

@jonasschnelli Fixed the CSubNet::ToString function for subnets that can't be represented as /x, please pick the top commit from https://github.com/laanwj/bitcoin/tree/2015_06_cideriad

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Jun 25, 2015

Member

Added @laanwj commit on top to support non CIDR compatible netmasks.

Member

jonasschnelli commented Jun 25, 2015

Added @laanwj commit on top to support non CIDR compatible netmasks.

@Diapolo

This comment has been minimized.

Show comment
Hide comment
@Diapolo

Diapolo Jul 29, 2015

Can this be rebased and get some love :)? Would be great to get this in soon...

Diapolo commented Jul 29, 2015

Can this be rebased and get some love :)? Would be great to get this in soon...

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Jul 29, 2015

Member

This PR doesn't need rebase and already has plenty love.
Ready for merge IMO.

Member

jonasschnelli commented Jul 29, 2015

This PR doesn't need rebase and already has plenty love.
Ready for merge IMO.

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Jul 29, 2015

Member

Here are some binaries if somebody want to test without ability to build: https://builds.jonasschnelli.ch/pulls/6315/

Member

jonasschnelli commented Jul 29, 2015

Here are some binaries if somebody want to test without ability to build: https://builds.jonasschnelli.ch/pulls/6315/

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Jul 29, 2015

Member

@Diapolo: you where right, needed adaption to the post QT_NO_KEYWORDS code.
Rebased and fixed.

Member

jonasschnelli commented Jul 29, 2015

@Diapolo: you where right, needed adaption to the post QT_NO_KEYWORDS code.
Rebased and fixed.

@jgarzik

This comment has been minimized.

Show comment
Hide comment
@jgarzik

jgarzik Sep 16, 2015

Contributor

ut ACK - ready to merge once conflicts fixed via rebase

Contributor

jgarzik commented Sep 16, 2015

ut ACK - ready to merge once conflicts fixed via rebase

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Sep 16, 2015

Member

Rebased (trivial).

Member

jonasschnelli commented Sep 16, 2015

Rebased (trivial).

@Diapolo

This comment has been minimized.

Show comment
Hide comment
@Diapolo

Diapolo Sep 16, 2015

Happy to see this moving again, I had the impression our GUI is dead...

Diapolo commented Sep 16, 2015

Happy to see this moving again, I had the impression our GUI is dead...

jonasschnelli and others added some commits Jun 19, 2015

[Qt] add ban functions to peers window
add ban option for peer context menu (1h, 24h, 7d, 1y).
[Qt] bantable overhaul
- some code cleanups
- fix date formatting
- reduce header includes
net: Fix CIDR notation in ToString()
Only use CIDR notation if the netmask can be represented as such.
[Qt] simplify ban list signal handling
- remove banListChanged signal from client model
- directly call clientModel->getBanTableModel()->refresh() without the way
  over clientModel->updateBanlist()

- also fix clearing peer detail window, when selecting (clicking)
  peers in the ban list
[Qt] bantable polish
- add missing NULL pointer checks
- add better comments and reorder some code in rpcconsole.cpp
- remove unneeded leftovers in bantable.cpp
- update bantable column sizes to prevent cutting of banned until
[Qt] reenabling hotkeys for ban context menu, use different words
- 1 (h)our
- 1 (d)ay
- 1 (w)eek
- 1 (y)ear
[Qt] call DumpBanlist() when baning unbaning nodes
- this matches RPC call behaviour
@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Sep 16, 2015

Member

Rebased. Travis is happy now.

Member

jonasschnelli commented Sep 16, 2015

Rebased. Travis is happy now.

@jtimon

This comment has been minimized.

Show comment
Hide comment
@jtimon

jtimon Sep 17, 2015

Member

Concept ACK

Member

jtimon commented Sep 17, 2015

Concept ACK

@luke-jr

This comment has been minimized.

Show comment
Hide comment
@luke-jr

luke-jr Sep 20, 2015

Member

Why does 7f90ea7 remove the DumpBanlist calls?

Member

luke-jr commented Sep 20, 2015

Why does 7f90ea7 remove the DumpBanlist calls?

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Sep 20, 2015

Member

Thank @luke-jr for the precise review.
I think this sneaked in over a rebase because this PR started before the banlist was persisted to disk.

Just added a commit that re-implenents the DumpBanlist() calls in case of banning/unbanning over QT.

Member

jonasschnelli commented Sep 20, 2015

Thank @luke-jr for the precise review.
I think this sneaked in over a rebase because this PR started before the banlist was persisted to disk.

Just added a commit that re-implenents the DumpBanlist() calls in case of banning/unbanning over QT.

@luke-jr

This comment has been minimized.

Show comment
Hide comment
@luke-jr

luke-jr Sep 20, 2015

Member

Note I did not do a precise review for this (yet?), just noticed those disappear from the previous version. ;)

Member

luke-jr commented Sep 20, 2015

Note I did not do a precise review for this (yet?), just noticed those disappear from the previous version. ;)

@laanwj laanwj merged commit 7aac6db into bitcoin:master Sep 22, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Sep 22, 2015

Merge pull request #6315
7aac6db [QT] dump banlist to disk in case of ban/unban over QT (Jonas Schnelli)
7f90ea7 [QA] adabt QT_NO_KEYWORDS for QT ban implementation (Jonas Schnelli)
07f70b2 [QA] fix netbase tests because of new CSubNet::ToString() output (Jonas Schnelli)
4ed0510 [Qt] call DumpBanlist() when baning unbaning nodes (Philip Kaufmann)
be89292 [Qt] reenabling hotkeys for ban context menu, use different words (Jonas Schnelli)
b1189cf [Qt] adapt QT ban option to banlist.dat changes (Jonas Schnelli)
65abe91 [Qt] add sorting for bantable (Philip Kaufmann)
51654de [Qt] bantable polish (Philip Kaufmann)
cdd72cd [Qt] simplify ban list signal handling (Philip Kaufmann)
43c1f5b [Qt] remove unused timer-code from banlistmodel.cpp (Jonas Schnelli)
e2b8028 net: Fix CIDR notation in ToString() (Wladimir J. van der Laan)
9e521c1 [Qt] polish ban table (Philip Kaufmann)
607809f net: use CIDR notation in CSubNet::ToString() (Jonas Schnelli)
53caec6 [Qt] bantable overhaul (Jonas Schnelli)
f0bcbc4 [Qt] bantable fix timestamp 64bit issue (Jonas Schnelli)
6135309 [Qt] banlist, UI optimizing and better signal handling (Jonas Schnelli)
770ca79 [Qt] add context menu with unban option to ban table (Jonas Schnelli)
5f42132 [Qt] add ui signal for banlist changes (Jonas Schnelli)
ad204df [Qt] add banlist table below peers table (Jonas Schnelli)
50f0908 [Qt] add ban functions to peers window (Jonas Schnelli)
@Diapolo

This comment has been minimized.

Show comment
Hide comment
@Diapolo

Diapolo Sep 22, 2015

@laanwj Now if #6371 could be merged, I'd be happy!

Diapolo commented Sep 22, 2015

@laanwj Now if #6371 could be merged, I'd be happy!

@str4d str4d referenced this pull request in zcash/zcash Jul 14, 2017

Open

Bitcoin 0.12 P2P/Net PRs 1 #2534

@str4d str4d referenced this pull request in zcash/zcash Dec 19, 2017

Open

banlist.dat: store banlist on disk #2812

zkbot added a commit to zcash/zcash that referenced this pull request Apr 5, 2018

Auto merge of #2812 - str4d:2074-store-banlist, r=<try>
banlist.dat: store banlist on disk

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6310
- bitcoin/bitcoin#6315
  - Only the new signal and net changes, no QT
- bitcoin/bitcoin#7350
- bitcoin/bitcoin#7458

Part of #2074.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment