diff --git a/src/statesync/user.cc b/src/statesync/user.cc index 1303eed..67cac17 100644 --- a/src/statesync/user.cc +++ b/src/statesync/user.cc @@ -43,9 +43,15 @@ using namespace ClientBuffers; void UserStream::subtract( const UserStream *prefix ) { + // if we are subtracting ourself from ourself, just clear the deque + if ( this == prefix ) { + actions.clear(); + return; + } for ( deque::const_iterator i = prefix->actions.begin(); i != prefix->actions.end(); i++ ) { + assert( this != prefix ); assert( !actions.empty() ); assert( *i == actions.front() ); actions.pop_front();